Click here to Skip to main content
15,896,377 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRead Foxpro dbf files Pin
pk_fox5-Feb-03 5:52
pk_fox5-Feb-03 5:52 
GeneralRe: Read Foxpro dbf files Pin
Stefan Pedersen5-Feb-03 11:17
Stefan Pedersen5-Feb-03 11:17 
GeneralRe: Read Foxpro dbf files Pin
Mike Nordell5-Feb-03 21:09
Mike Nordell5-Feb-03 21:09 
GeneralRe: Read Foxpro dbf files Pin
pk_fox5-Feb-03 23:38
pk_fox5-Feb-03 23:38 
GeneralRe: Read Foxpro dbf files Pin
Mike Nordell12-Feb-03 9:24
Mike Nordell12-Feb-03 9:24 
GeneralWin9x error Pin
Anonymous5-Feb-03 5:34
Anonymous5-Feb-03 5:34 
GeneralRe: Win9x error Pin
David Chamberlain5-Feb-03 6:07
David Chamberlain5-Feb-03 6:07 
GeneralRe: Win9x error Pin
Joaquín M López Muñoz5-Feb-03 8:36
Joaquín M López Muñoz5-Feb-03 8:36 
Not only you don't have to call the W2k-only functions, also you cannot link them: When the program uses some Win32 function, it is linking against a so called import .lib, which loads the corresponging DLL and arranges everything so that when the time comes to call the function, everything works. The problem with a W2k-only function is that the import library will try to load it even if the program never calls it!
You have two options:
  • Do the loading yourself, as in this example with TryEnterCriticalSection:
    BOOL (WINAPI * pTryEnterCriticalSection)(LPCRITICAL_SECTION lpCriticalSection);
      
    HMODULE hKernel32;
      
    void LoadW2kFunctions()
    {
      hKernel32=LoadLibrary("KERNEL32");
      (FARPROC&)pTryEnterCriticalSection=GetProcAddress(hKernel32,"TryEnterCriticalSection");
    }
      
    ...
    if(OS is W2k){
      LoadW2kFunctions
    }
    ...
    if(OS is W2k){
      pTryEnterCriticalSection(...); // use as with normal TryEnterCriticalSection
    }
    else{
       ...
    }
    This is hard work, you'll probably find some problems along the way.
  • In VC++ 7.0, there's an option called delayed loading which loads DLLs the first time thery're used. If you have this compiler, this is surely the fastest way to get your problem solved.


Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
GeneralRe: Win9x error Pin
Anonymous5-Feb-03 22:57
Anonymous5-Feb-03 22:57 
GeneralRe: Win9x error Pin
Anonymous5-Feb-03 23:00
Anonymous5-Feb-03 23:00 
GeneralErrors in createthread file. Need help! Pin
Pecan2045-Feb-03 5:24
Pecan2045-Feb-03 5:24 
GeneralRe: Errors in createthread file. Need help! Pin
Anonymous5-Feb-03 5:48
Anonymous5-Feb-03 5:48 
GeneralRe: Errors in createthread file. Need help! Pin
Anonymous5-Feb-03 5:56
Anonymous5-Feb-03 5:56 
GeneralRe: Errors in createthread file. Need help! Pin
-=jarl=-5-Feb-03 6:54
-=jarl=-5-Feb-03 6:54 
GeneralRe: Errors in createthread file. Need help! Pin
Pecan2045-Feb-03 8:15
Pecan2045-Feb-03 8:15 
GeneralGUI Dll Problems Pin
Ricky_TheBard5-Feb-03 5:08
Ricky_TheBard5-Feb-03 5:08 
GeneralGetDlgItem question. Pin
Maximilien5-Feb-03 4:13
Maximilien5-Feb-03 4:13 
GeneralRe: GetDlgItem question. Pin
Paul M Watt5-Feb-03 8:13
mentorPaul M Watt5-Feb-03 8:13 
GeneralRe: GetDlgItem question. Pin
Abbas_Riazi5-Feb-03 22:24
professionalAbbas_Riazi5-Feb-03 22:24 
Questionusing template functions as part of a class? is it possible? Pin
Joan M5-Feb-03 4:09
professionalJoan M5-Feb-03 4:09 
AnswerRe: using template functions as part of a class? is it possible? Pin
-=jarl=-5-Feb-03 4:36
-=jarl=-5-Feb-03 4:36 
GeneralRe: using template functions as part of a class? is it possible? Pin
Joan M5-Feb-03 4:44
professionalJoan M5-Feb-03 4:44 
GeneralRe: using template functions as part of a class? is it possible? Pin
-=jarl=-5-Feb-03 4:46
-=jarl=-5-Feb-03 4:46 
GeneralRe: using template functions as part of a class? is it possible? Pin
-=jarl=-5-Feb-03 4:48
-=jarl=-5-Feb-03 4:48 
AnswerRe: using template functions as part of a class? is it possible? Pin
Joaquín M López Muñoz5-Feb-03 8:14
Joaquín M López Muñoz5-Feb-03 8:14 

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.