Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / May 2004

Tip: Looking for answers? Try searching our database.

unmanaged code in VC++.net

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rb - 12 May 2004 00:22 GMT
Hi

 

I am trying to write an unmanaged C++ program using
VS.NET 2003. Its giving some errors. So, my question is
can we write unmanaged code in C++. This is the program I
wrote. Can you suggest me some material which I can refer
for this?



#include <iostream>



using namespace std;



BOOL __stdcall DllMain(HINSTANCE hInst, DWORD dwReason,
LPVOID lpReserved)

{

     return TRUE;

}



extern "C" __declspec(dllexport) int GetIntegerA()

{

     return 23;

}



The error I am getting is



): error C2143: syntax error : missing ';'
before '__stdcall'

error C2501: 'BOOL' : missing storage-class or type
specifiers

error C2065: 'HINSTANCE' : undeclared identifier

error C2146: syntax error : missing ')' before
identifier 'hInst'

warning C4229: anachronism used : modifiers on data are
ignored

error C2501: 'DllMain' : missing storage-class or type
specifiers

error C2059: syntax error : ')'

error C2143: syntax error : missing ';' before '{'

error C2447: '{' : missing function header (old-style
formal list?)



Any help is appreciated,



thanks
mccoyn - 12 May 2004 01:01 GMT
BOOl, HINSTANCE, DWORD and LPVOID are not defined by default.  Including windows.h will define these types.  Another option is to use standard types like bool, int and void*.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.