Click here to Skip to main content
15,908,626 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: serial communication [modified] Pin
earl3-Jul-06 17:54
earl3-Jul-06 17:54 
AnswerRe: serial communication Pin
Rilhas9-Jul-06 5:19
Rilhas9-Jul-06 5:19 
QuestionStdAfx questions Pin
Super Lloyd3-Jul-06 17:04
Super Lloyd3-Jul-06 17:04 
AnswerRe: StdAfx questions Pin
Michael Dunn3-Jul-06 17:10
sitebuilderMichael Dunn3-Jul-06 17:10 
GeneralRe: StdAfx questions Pin
Super Lloyd3-Jul-06 18:32
Super Lloyd3-Jul-06 18:32 
AnswerRe: StdAfx questions Pin
Saurabh.Garg3-Jul-06 20:58
Saurabh.Garg3-Jul-06 20:58 
GeneralRe: StdAfx questions Pin
Super Lloyd3-Jul-06 21:07
Super Lloyd3-Jul-06 21:07 
QuestionProblem with GetProcAddress Pin
RedDragon2k3-Jul-06 16:39
RedDragon2k3-Jul-06 16:39 
Hey Guys,

I got a piece of Unix Code but I have to make it run under Windows. Unfortunately I contains the function mmap (a Unix Function). Fortunately there is this nice DLL called cygwin1.dll which gives you some Unix Functions.

<br />
    HINSTANCE hDll = LoadLibrary("cygwin1.dll");<br />
    if(hDll)<br />
    {<br />
            printf("DLL Loaded !\r\n");<br />
            FARPROC mmap = GetProcAddress(hDll,"mmap");<br />
            if(mmap)<br />
            {<br />
                    printf("Function found !\r\n");<br />
                    mydata= mmap(mydata, myLength,PROT_READ,MAP_PRIVATE,fd,0);<br />
            }<br />
            else<br />
            {<br />
                    printf("Function not found!\r\n");<br />
            }<br />
    }<br />
    else<br />
    {<br />
            printf("Failed to load DLL!\r\n");<br />
    }<br />

This is the code I use. But when I then try to call the mmap function my compiler tells me that I'm passing to many arguments to mmap. WTF | :WTF:
Normally I don't load libraries at runtime. So please help me Sigh | :sigh:
AnswerRe: Problem with GetProcAddress Pin
earl3-Jul-06 17:52
earl3-Jul-06 17:52 
AnswerRe: Problem with GetProcAddress Pin
Hamid_RT3-Jul-06 20:21
Hamid_RT3-Jul-06 20:21 
Questionnewfile , new window in MDI Pin
zeus_master3-Jul-06 15:59
zeus_master3-Jul-06 15:59 
AnswerRe: newfile , new window in MDI Pin
zeus_master3-Jul-06 18:35
zeus_master3-Jul-06 18:35 
AnswerRe: newfile , new window in MDI [modified] Pin
*Dreamz3-Jul-06 20:08
*Dreamz3-Jul-06 20:08 
Questionc++ and external structs [modified] Pin
earl3-Jul-06 14:25
earl3-Jul-06 14:25 
AnswerRe: c++ and external structs Pin
Michael Dunn3-Jul-06 16:59
sitebuilderMichael Dunn3-Jul-06 16:59 
QuestionNew Dialog in a saved .exe Pin
Reagan Conservative3-Jul-06 7:05
Reagan Conservative3-Jul-06 7:05 
AnswerRe: New Dialog in a saved .exe Pin
Zac Howland3-Jul-06 7:10
Zac Howland3-Jul-06 7:10 
GeneralRe: New Dialog in a saved .exe Pin
Reagan Conservative3-Jul-06 8:20
Reagan Conservative3-Jul-06 8:20 
GeneralRe: New Dialog in a saved .exe Pin
Zac Howland3-Jul-06 8:38
Zac Howland3-Jul-06 8:38 
GeneralRe: New Dialog in a saved .exe Pin
Reagan Conservative3-Jul-06 9:56
Reagan Conservative3-Jul-06 9:56 
GeneralRe: New Dialog in a saved .exe Pin
Zac Howland3-Jul-06 12:29
Zac Howland3-Jul-06 12:29 
AnswerRe: New Dialog in a saved .exe Pin
zeus_master3-Jul-06 15:42
zeus_master3-Jul-06 15:42 
GeneralRe: New Dialog in a saved .exe Pin
Reagan Conservative5-Jul-06 5:40
Reagan Conservative5-Jul-06 5:40 
AnswerRe: New Dialog in a saved .exe Pin
dongqin3-Jul-06 18:41
dongqin3-Jul-06 18:41 
AnswerRe: New Dialog in a saved .exe Pin
MANISH RASTOGI3-Jul-06 19:52
MANISH RASTOGI3-Jul-06 19:52 

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.