Click here to Skip to main content
15,920,633 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Question__declspec(dllimport) Pin
_808613-Jun-09 1:50
_808613-Jun-09 1:50 
AnswerRe: __declspec(dllimport) Pin
Randor 13-Jun-09 5:27
professional Randor 13-Jun-09 5:27 
GeneralRe: __declspec(dllimport) Pin
_808613-Jun-09 21:47
_808613-Jun-09 21:47 
GeneralRe: __declspec(dllimport) Pin
_808614-Jun-09 4:46
_808614-Jun-09 4:46 
GeneralRe: __declspec(dllimport) Pin
Randor 14-Jun-09 5:20
professional Randor 14-Jun-09 5:20 
QuestionCalling DLL function that is not imported(MFC and WinMain) Pin
sawerr13-Jun-09 0:50
sawerr13-Jun-09 0:50 
AnswerRe: Calling DLL function that is not imported(MFC and WinMain) Pin
sgenie6813-Jun-09 1:13
sgenie6813-Jun-09 1:13 
AnswerRe: Calling DLL function that is not imported(MFC and WinMain) Pin
Rajesh R Subramanian13-Jun-09 2:26
professionalRajesh R Subramanian13-Jun-09 2:26 
sawerr wrote:
We know that, WinMain is buried in the MFC Framework. OK but how can Windows call it?


The linker tries to locate and execute an entry-point in your code, which may be dependent on the type of application you are building: WinMain (or wWinMain if built for Unicode) or main (or wmain if built for Unicode). The former is for windowed applications and the latter is for console applications. If no entry point is defined in your application, you will get an undeclared identifier from the linker.



sawerr wrote:
If i import a dll and although i do not use one of the imported function in that dll, OS can still call that function? Or OS can only call imported dll functions which are used by exe?? If the function doesn't import by exe, it is never be called?


That depends. There are DLLs that you may not reference directly from your code but Windows will load and execute code from those libraries. This is because some of the functions in those libraries may be indirectly referenced. Other than that, only what you are calling from your code will be loaded or executed.

The fact is that this is a larger topic to be discussed in a thread like this. If you really are wanting to read up on how programs work and how Windows work, I'll recommend the book by Jeffrey Richter and Christopher Nasarre (every edition of the book gets a new name. The latest one is called Windows Via C/C++).


It is a crappy thing, but it's life -^ Carlo Pallini

GeneralRe: Calling DLL function that is not imported(MFC and WinMain) Pin
sawerr13-Jun-09 3:17
sawerr13-Jun-09 3:17 
GeneralRe: Calling DLL function that is not imported(MFC and WinMain) Pin
sgenie6813-Jun-09 22:22
sgenie6813-Jun-09 22:22 
QuestionHow to open a logical partition and read all of its file using windows function ReadFile() ? Pin
krish_kumar12-Jun-09 22:53
krish_kumar12-Jun-09 22:53 
QuestionRe: How to open a logical partition and read all of its file using windows function ReadFile() ? Pin
Randor 13-Jun-09 5:38
professional Randor 13-Jun-09 5:38 
AnswerRe: How to open a logical partition and read all of its file using windows function ReadFile() ? Pin
krish_kumar13-Jun-09 6:27
krish_kumar13-Jun-09 6:27 
GeneralRe: How to open a logical partition and read all of its file using windows function ReadFile() ? Pin
Stuart Dootson13-Jun-09 12:59
professionalStuart Dootson13-Jun-09 12:59 
GeneralRe: How to open a logical partition and read all of its file using windows function ReadFile() ? Pin
Randor 14-Jun-09 6:14
professional Randor 14-Jun-09 6:14 
GeneralRe: How to open a logical partition and read all of its file using windows function ReadFile() ? Pin
krish_kumar14-Jun-09 18:32
krish_kumar14-Jun-09 18:32 
GeneralRe: How to open a logical partition and read all of its file using windows function ReadFile() ? Pin
Randor 15-Jun-09 7:37
professional Randor 15-Jun-09 7:37 
GeneralRe: How to open a logical partition and read all of its file using windows function ReadFile() ? [modified] Pin
krish_kumar15-Jun-09 15:19
krish_kumar15-Jun-09 15:19 
GeneralRe: How to open a logical partition and read all of its file using windows function ReadFile() ? Pin
krish_kumar19-Jun-09 20:01
krish_kumar19-Jun-09 20:01 
Questionvirtual constructor Pin
siva45512-Jun-09 22:11
siva45512-Jun-09 22:11 
AnswerRe: virtual constructor Pin
Rajesh R Subramanian12-Jun-09 22:16
professionalRajesh R Subramanian12-Jun-09 22:16 
AnswerRe: virtual constructor Pin
Cedric Moonen12-Jun-09 23:09
Cedric Moonen12-Jun-09 23:09 
GeneralRe: virtual constructor Pin
Arun Singh K13-Jun-09 0:57
Arun Singh K13-Jun-09 0:57 
QuestionC++ dll for Excel -> Is it possible to return strings with > 255 characters in Excel? [modified] Pin
T210212-Jun-09 22:00
T210212-Jun-09 22:00 
AnswerRe: Possible to return strings with >255 characters in Excel? Pin
Rajesh R Subramanian12-Jun-09 22:10
professionalRajesh R Subramanian12-Jun-09 22:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.