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...
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...
That's it, you solved it!!!! Thank you very much. I knew it had to be some simple one-liner. I want to star your post, but my browser doesn't respond to the "Thank you" link for some reason. So thanks anyway...
Here's a very simplified version of my drawing code. The Picture's Autoredraw is set to False. Note that the call to TimeStepLoop is actually a call to a function in a DLL library that I created in C++. This function loops through some calculations and returns the set of X and Y coordinates...
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...
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...
Thanks so much for the help. I figured it out. I just modified your KbTest function with the following code:
bool KeyboardTest()
{
if (GetAsyncKeyState(VK_ESCAPE)!=0)
{
return true;
}
return false;
}
and it works... Thanks again,
Nikolai.
Thanks alot for the tips...
ArkM: I tried implanting a version of your code into mine, but for some reason there is no response to any key presses. _kbhit() always returns 0 regardless of what key I press!?!
The loop I am trying to interrupt is in a DLL that I call from a separate executable...
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.
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:\...
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...
Ahah! Thank you both for clarifying the problem. Makes sense now. This is my modified code now, which works:
void MyFunction(float StartTime, float TimeStep, float Interval)
{
do
{
StartTime = MyLoop(StartTime,TimeStep,Interval);
} while(StartTime<5);
return
}
float...
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...
Thank you very much for the explanation. That was my problem: the wide strings versus the narrow strings. I ended up just scrapping most of the above code and using this MUCH simpler version instead:
void __declspec(dllexport) CALLBACK myfunction(BSTR mybstr)
{
LPSTR mychar; // narrow...
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...
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...
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...
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...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.