|
I'm using LoadLibrary and GetProcAddress to pull a function from a DLL. This is working okay but when I call the function, I get this from the Debug Library:
"The value of ESP was not properly saved across a function call. This is usually a result of a calling function declared with one calling convention with a function pointer declared with a different calling convention."
Now I know this means that I'm using the wrong definition for my function pointer. Unfortunately, I don't know what the exact definition should be (and the person who can tell me is on holiday!).
I know that it's two strings in and an integer return. I've tried:
typedef int (*FUNCPTR1) (LPSTR Key, LPSTR Licensee);
typedef int (*FUNCPTR1) (LPCSTR Key, LPCSTR Licensee);
neither of which work.
So does anyone have any idea how I can extract the correct definition from the DLL?
Paul
|
|
|
|
|
|
Isn't __cdecl for in the DLL? I know it's being exported with the right name.
Where would I put __cdecl in the calling program?
Paul
|
|
|
|
|
In dll
void _stdcall aa(){};
In app
void(_stdcall* )() tmp = GetProcAddress(..);
i think above will pass
|
|
|
|
|
If I try any variation on this theme, I get "Syntax Error : ')'" on the closing parenthesis after _stdcall*
Paul
|
|
|
|
|
i'm sorry , should like this
void(_stdcall* tmp)() = GetProcAddress(..);
OR
typedef void(_stdcall* funType)();
funType tmp = GetProcAddress(..);
|
|
|
|
|
That's the answer I'm looking for. Thanks, that works great!
Paul
|
|
|
|
|
The fastest solution to this problem is by removing the "/GZ" from the "Project Options" listbox
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hmmm... yeah, I guess so. Unfortunately, I was using the debug version because the release version wasn't working properly either.
The problem I have is that I'm writing custom actions for Windows Installer DLLs; sometimes these call other DLLs from SUPPORTDIR because the Installshield wrapper for standard DLLs is really poor.
Unfortunately because we have many users who run Silent Installs, we have to be able to run the DLL without any visible output. So I have a release version that's simply forcing the installer into Rollback and a Debug version that gives me all the right message boxes but then crashes like this.
It's all kind of tacky but what can you do?
All sorted now anyway, just a missing _stdcall.
Paul
|
|
|
|
|
My vc6 always creates a project as a debug version. Is there a way to change the default to release version?
I've already looked inside tools->customize and tools->options but I can't find it.
using: [VISUAL STUDIO 6.0] [WIN98/2]
|
|
|
|
|
Nope. You are expected to get rid of all bugs before release
...if you're under 8 or younger. Chris Maunder, the Lounge
|
|
|
|
|
Me never mistaking makes! Me is name Billy Gaytes...
using: [VISUAL STUDIO 6.0] [WIN98/2]
|
|
|
|
|
Bill G. makes mistakes. But Bill S. doesnt
...if you're under 8 or younger. Chris Maunder, the Lounge
|
|
|
|
|
Who's Bill S??
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
search for Bill S in the lounge if you dare
...if you're under 8 or younger. Chris Maunder, the Lounge
|
|
|
|
|
Sorry i asked, didnt mean to bring u bad memory indeed
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
LOL
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
That setting is probably in the same place as the "don't make useless readme.txt files upon project creation" setting.
Seriously though, I don't know.
_____________________
"So in the interests of survival, they trained themselves to be agreeing machines instead of thinking machines. All their minds had to do was to discover what other people were thinking, and then they thought that, too."
Breakfast of Champions, Kurt Vonnegut
|
|
|
|
|
Does anyone know how to get the system time and store it in a variable in vc6? also, do you know how to get the country from the system and store that in a variable as well?
|
|
|
|
|
Have a look at GetSystemTime / GetLocalTime on MSDN.
Michael
Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.
|
|
|
|
|
In my application, I'm using a TreeCtrl to display some hierachical information about the setting of the information.
I want it to be shown like:
[B] Solutions
|
---+[F] Solution Users
|
---+[F] Materials
I want Solution Users and Materials are not initially expanded (Items not populated until the + is clicked).
[B] and [F] here represents two images.
By the way, I don't know how to create image list for it, should i create a bit map of 2 x 16 x 15 to hold the images, and load it into CImageList, and set it to the tree ??
|
|
|
|
|
Yes, at 1st you shoul create image list, then attach it to the tree. When you'll want to add tree item, specify the index of the image in the image list
_________________________
Warm regards,
Vladimir V. Polischuk
AlarIT Inc.
Developer
URL: http://www.alarit.com
|
|
|
|
|
what is the different between this two declaration of pointer:
1) int* inta;
and
2) int *inta;
|
|
|
|
|
The readability.
Technicaly there is no difference at all. You can write int * inta or even put it in diffent lines. Whitespaces dont count (in most cases).
In my opinion its more readable to see int* pvariable; then int *pvariable; because it is not an integer variable but a integer pointer variable.
But thats only my 2 €-cents.
...if you're under 8 or younger. Chris Maunder, the Lounge
|
|
|
|
|
This is a bit of a mess in C/C++
int* pvariable; seems good from some points of view but it suggests that int* is a variable type.
What about:
int* pvariable, p2;
is p2 a pointer? NO! It's an int. For this reason I always write int *p, *p2; ... the * really belongs with the variable name not with the type.
That was just my £0.02
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|