Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: nhungr
  • Content: Threads
  • Order by date
  1. nhungr

    Text file output

    Hello. I have a C++ function that ouputs a set of data text files. I pass the directory path of where I want the files to be stored to the function through a BSTR variable. I then need the function to take this path string and append it to the front of the name of each text file. For...
  2. nhungr

    Division operator that returns an integer

    Hello. Is there an operator or function in C++ that allows you to divide two numbers and return just the integer part (ie. the number on the left side of the decimal point)? The opposite of the modulus (%) operator! Examples: 7 / 2 would return the integer 3 14 / 3 would return the integer 4...
  3. nhungr

    Drawing points in a Picture control

    Hello. I am trying to draw points in a Picture control overtop of an image. I initially load an image into an Image control that I've placed inside the Picture boundaries. Then I stretch the image to the size of the Picture control. Then I run a loop that should draw a set of points every...
  4. nhungr

    __declspec VERSUS _stdcall

    I'm calling a C++ DLL from another application written in Visual Basic. When declaring a function in the DLL, what's the difference between using __declspec as opposed to _stdcall? For example: void __declspec(dllexport) CALLBACK MyFunction() //or: void _stdcall MyFunction() Is one...
  5. nhungr

    How to prematurely escape a While Loop

    I am writing a C++ DLL that runs a very long While loop. How can I allow the user to break out of this loop by pressing Esc on the keyboard? Thanks alot! Nikolai.
  6. nhungr

    Scaling using SetWindowExtEx

    Hello. I am having problems scaling a Visual Basic Picture control from a C++ DLL. Here is the code that I am using: In Visual Basic, I call the scaling routine in the C++ DLL using the following code: Call ScalePicture(Picture1.hWnd, Picture1.hDC) where: Declare Sub ScalePicture Lib "C:\...
  7. nhungr

    Rescaling a Picture from a C++ DLL

    Hello. I have a Visual Basic 6 program that calls a C++ DLL that I am in the process of writing. The DLL does some calculations and should draw some points in a Picture form contained in the VB exe. How can I scale the Picture form to a custom scale from the C++ DLL, so that the points are...
  8. nhungr

    While loop malfunction

    Hello. I've run into a strange problem that I can't figure out. It involves a while loop that sometimes loops one too many times for some unknown reason. A simplified version of my code is included below: void MyFunction(float StartTime, float TimeStep, float Interval) { do { StartTime...
  9. nhungr

    HELP!!! How to convert BSTR type to char*

    I have a BSTR type variable (passed in from a Visual Basic application) that I'm trying to convert into a char* so that I can use it in an iostream. For some reason, the conversion function that I'm using only converts every SECOND character of the BSTR variable to the char variable. For...
  10. nhungr

    Writing a DLL in C++ for use in a Visual Basic Progam

    I have a C++ program that does a long set of calculations for up to 45 minutes. At periodic intervals during the calculations, it outputs some values and comments. Is it possible to turn this program into a Dynamic Link Library (DLL) and then run it from a Visual Basic interface. I was...
  11. nhungr

    Redrawing the screen

    I have a simple SDI program that prints text onto the window using a CPaintDC device context. However, whenever I drag another window overtop, minimize and maximize, or scroll the window, the text that has been covered up gets erased. How do I prevent this from happening? Thanks for the help...
  12. nhungr

    Customizing screen coordinates

    I'm having problems visualizing in my mind the physical relationship between logical coordinates and device coordinates when using the mapping modes MM_ANISOTROPIC / MM_ISOTROPIC and the CDC:SetWindowExt() and SetViewportExt() member functions to customize screen coordinates. I am trying to...
  13. nhungr

    How to implement Scroll bars?

    Hello. In Visual C++, Is there a simple way of implementing scrollbars into a CWnd class (in an SDI application) without using CScrollView? My program prints a whole column of data on a blank window, and I need to be able to scroll down to the bottom of the list. Thanks for any tips, Nikolai.
  14. nhungr

    C++ Data Conversion

    How do I convert an integer variable to a char that can be displayed onto the screen? For example, this is the code I'm using, but it won't write out the value of the integer: int anynum = 0; char mymessage[30]={0}; strcpy(mymessage,"My number is: ")...
  15. nhungr

    CPaintDC device context question

    In Visual C++, if I create a CPaintDC object in a global function (any function other than the OnPaint message-handler), as follows: void myfunction(CWnd* pWnd) { CPaintDC dc(CWnd* pWnd); CPen newpen; CPen* oldpen; newpen.CreatePen(PS_SOLID,1,RGB(0,0,0))...
  16. nhungr

    Help with Visual C++ graphics in SDI application

    I’m having problems trying to draw simple graphics (using the CDC::Ellipse function) in my SDI application. My program consists of the following classes : class CMainFrame : public CframeWnd class CChildView : public CWnd class CVDANApp : public CWinApp I also have a menu resource. I need...

Part and Inventory Search

Back
Top