We help IT Professionals succeed at work.

a strange question that upset me a whole day.

Dreadknight
Dreadknight asked
on
I write a console app(MSDOS based)to initialize a hardware, everything is ok.
But if I put the same code into a MFC dialog based app,the hardware ini is uncomplete though there is warnign or error generated.
Comment
Watch Question

Commented:
Well, please stop being upset about this, especially for a whole day.  Just stop making whatever mistake you are making and things will be happy.

Of course, if you'd like to get help here, you'll need to provide more details about what you are doing, what kind of hardware you are talking about, and what version of Windows you're using.
CERTIFIED EXPERT
Author of the Year 2009
Commented:
Whenever I get upset for a whole day, I just throw the computer out of the window.  It helps.

-- Dan

Author

Commented:
Hardware: overlay card (PCI slot) used to add overlay to analog TV signals ,It use Interrupt 11 and memory 00000000-00ffffff.

what I do is initializing,include open VXD,create interrupt,and map memorry.

the code I write works well in console(msdos)based app.
but not in dialog app.

could someone help me?

the ini code is as following.
/////////////////////////////////////////////////////////////
     

// Load the VxD
     if ((MT_OpenDriver())== INVALID_HANDLE_VALUE)
     {
                ......error handling......
          exit(1);
     }

/////////////////////////////////////////////////////////////
     if(!MT_CreateIntEvent())
     {
          ......error handling......
           exit(1);
     }


/////////////////////////////////////////////////////////////////
//Init the EPF6016(a chip that do digital operation).

     if(!MT_SystemInit())
     {
          ......error handling......
          exit(1);
     }
     
//////////////////////////////////////////////////////////////////
///for MemMap ,that is to get the start address
//of hardware.

     pBuffer=MT_MapMemory();
     if(pBuffer==0)
     {
     ......error handling......
          exit(1);
     }
                   
///////////////////////////////////////////////    
///////////////////////////////////////////////    

Commented:
What does this have to do with MFC?

Commented:
what breaks?
are you using  inline asm?

Author

Commented:
I didnot throw the computer,just turn power off a whole day.
it help
CERTIFIED EXPERT
Author of the Year 2009

Commented:
I'm glad you have a sense of humor.  I wish I could have helped more.  

-- Dan

Author

Commented:
I don't need your help. because
I have only one computer,so if you throw it,I can't work

Explore More ContentExplore courses, solutions, and other research materials related to this topic.