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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Messy Problem ( C2501 Error)

Status
Not open for further replies.

stef88

MIS
Apr 27, 2007
13
GB
I created a Win 32 Dynamic-Link Library and set up a DLL file.

The problem appers when i try to declare variables like:

CSTRING var1;
HINSTANCE hinstDLL;

and others...
Does anyone have a solution please?
Thank you!
 
Try
Code:
CString var1; // Note string is in lowercase: not uppercase
 
Sorry, mea culpa.
I didn't write the example well... It's CString var1; and it doesn't work, i get that error...
 
Since we don't have thousands of compiler error codes memorized, it helps to also display the error message:
Code:
'identifier' : missing storage-class or type specifiers

This error is usually because you didn't include the right header file.
 
I've got the dll over here

Error C2146: syntax error : missing ';' before identifier 'asd1'
error C2501: 'CString' : missing storage-class or type specifiers
fatal error C1004: unexpected end of file found

These 3 are at the same line...

I've got the project over here. Maybe it would be a help.
Thank you!
 
I fixed the bug. The solution was including this code in the hookdll.cpp file

#include "stdafx.h"
#include "afxwin.h" //!! in this order
...

Also I had to delete DllMain() function from the cpp file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top