|
Foloowing is the corrected code written in file called example.cpp:
#include <afxwin.h>
class CMainWin :public CFrameWnd
{
public:
CMainWin();
DECLARE_MESSAGE_MAP()
};
CMainWin ::CMainWin()
{
Create(NULL,"Hello");
}
class CApp:public CWinApp
{
public:
bool InitInstance();
};
Bool CApp :: InitInstance()
{
m_pMainWnd= new CMainWin;
m_pMainWnd ->ShowWindow(m_nCmdShow);
m_pMainWnd ->UpdateWindow();
return TRUE;
}
BEGIN_MESSAGE_MAP(CMainWin,CFrameWnd)
END_MESSAGE_MAP()
CApp App;
following error r encountered:
1)c:\program files\microsoft visual studio\vc98\include\winnt.h(86) : error C2144: syntax error : missing ';' before type 'long'
2)c:\program files\microsoft visual studio\vc98\include\winnt.h(86) : fatal error C1004: unexpected end of file found
neha
|
|
|
|
|
What file you are supposed include at #include statement at the very beginning?
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Sorry following is the code:
#include<afxwin.h>
class CMainWin :public CFrameWnd
{
public:
CMainWin();
DECLARE_MESSAGE_MAP()
};
CMainWin ::CMainWin()
{
Create(NULL,"Hello");
}
class CApp:public CWinApp
{
public:
bool InitInstance();
};
Bool CApp :: InitInstance()
{
m_pMainWnd= new CMainWin;
m_pMainWnd ->ShowWindow(m_nCmdShow);
m_pMainWnd ->UpdateWindow();
return TRUE;
}
BEGIN_MESSAGE_MAP(CMainWin,CFrameWnd)
END_MESSAGE_MAP()
CApp App;
neha
-- modified at 7:15 Wednesday 23rd May, 2007
neha
|
|
|
|
|
i dnt know is this a problem in printing or what???
but i have included
afxwin.h
-- modified at 7:25 Wednesday 23rd May, 2007
|
|
|
|
|
Sorry Neha,
I could not see any bug in your code unless some spelling mistakes
#include <afxwin.h><br />
<br />
class CMainWin :public CFrameWnd<br />
{<br />
public:<br />
CMainWin();<br />
DECLARE_MESSAGE_MAP()<br />
};<br />
<br />
<br />
CMainWin ::CMainWin()<br />
{<br />
Create(NULL,"Hello");<br />
}<br />
<br />
<br />
class CApp:public CWinApp<br />
{<br />
public:<br />
BOOL InitInstance();<br />
};<br />
<br />
BOOL CApp :: InitInstance()<br />
{<br />
m_pMainWnd= new CMainWin;<br />
m_pMainWnd ->ShowWindow(m_nCmdShow);<br />
m_pMainWnd ->UpdateWindow();<br />
return TRUE;<br />
}<br />
<br />
BEGIN_MESSAGE_MAP(CMainWin,CFrameWnd)<br />
END_MESSAGE_MAP()<br />
<br />
CApp App;
The above code worked fine for me.
-- modified at 8:31 Wednesday 23rd May, 2007
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
tyagineha wrote: #include <afxwin.h>
This should be "stdafx.h" instead.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Any One please Give links on OTL connectivity. i searched googlee & was not able to get useful links
|
|
|
|
|
|
If I am going to write some data to a USB device in my user mode application (not driver) via USB channel, is there any API or software library in C/C++ for this purpose?
Thanks!
Maxwell Chen
|
|
|
|
|
You have to open the associated USB driver and communicat with it. Now, what you can do with it highly depends of the device you try to communicate with. Whith what are you trying to communicate ?
|
|
|
|
|
Cedric Moonen wrote: Whith what are you trying to communicate ?
My colleague told me to make a utility which can write some data into his micro-controller via USB this morning.
Maxwell Chen
|
|
|
|
|
Well, he then need to supply you with the appropriate USB driver. And with some documentation about this driver. In general, you open the driver using CreateFile and then you can use the standard ReadFile and WriteFile functions. But, you can also exchange some specific commands with the driver using DeviceIOControl (in which case, the code you pass to your driver is very specific).
|
|
|
|
|
Thank you very much!
Maxwell Chen
|
|
|
|
|
hi,
I have a multithreaded program.
In one thread, I have a very important section. I want to put all other thread to sleep when this thread comes to this section. Is there anyway to do this?
The data in this section is accessed from many many places so it's almost impossible to use CCriticalSection to lock it.
thanks for any help.
|
|
|
|
|
You'd be much better off putting in the effort to hide this data behind some interface with locking built in than try to put all the other threads to sleep.
Im sure you can find api's to enumerate the threads in your program and pause each of them but I think that would be very dangerous
|
|
|
|
|
GameProfessor wrote: hi,
I have a multithreaded program.
In one thread, I have a very important section. I want to put all other thread to sleep when this thread comes to this section. Is there anyway to do this?
The data in this section is accessed from many many places so it's almost impossible to use CCriticalSection to lock it.
This is a bad design and is asking for trouble. My advice would be "don't go there". Apart from the pitfalls[^] of putting threads to "sleep", how can you be sure one of the threads hasn't been interrupted in the middle of an update operation to the shared data and left it in an invalid state?
Steve
|
|
|
|
|
thanks, although your comment make me creepy :
I think I'll try Josh Gray's advice: trying to build a interface to lock my section. It could be difficult but it seems worthy to try.
|
|
|
|
|
How do i use the push button function to activate the LEDs connected through the parallel port?
i got a source code that uses check boxes to toggle the LEDs but instead of having current flow through the whole time when the check boxes are clicked, i decided to use the push button as it allows the current to flow through whenever it is pressed.
is it easier to control the LEDs using the keyboard arrows? if so how? are there any examples of source codes?
|
|
|
|
|
I think you have to implement a customize button to get that effect, because you need an action when the button is just pressed and stop that action when it is released.
You can use keydown message for handling the keyboard.
- NS -
|
|
|
|
|
I have some simple questions , thank you very much...
1. How can i get Owner and Group SIDs and matched username and groupnames for a file/folder using windows registry ?
2. How can i get SACL and DACL of a file/folder using windows registry ?
|
|
|
|
|
Akin Ocal wrote: 1. How can i get Owner and Group SIDs and matched username and groupnames for a file/folder using windows registry ?
2. How can i get SACL and DACL of a file/folder using windows registry ?
Both of these can be acheived with API's rather than looking at the registry directly. Search MSDN to find the required API functions
|
|
|
|
|
|
I have some simple questions , thank you very much...
1. How can i get Owner and Group SIDs and matched username and groupnames of a file/folder ?
2. How can i get DACL and SACL of a file/folder ? Are they human-readable , if not how can they be parsed into a human-readable form ?
3. How can i get number of data streams and read data streams ( without changing access-time) of a file/folder ?
|
|
|
|
|
I have set the cursor property of my Windows Form to "No". When I move between records the cursor switches to the arrow.
If I click anywhere on the form, outside of a field, the cursor changes to the desired "No" cursor.
What I am asking help with is the line of code that will simulate the user clicking the mouse?
Thanking you in advance for your help and time.
|
|
|
|
|
You can use the SendMessage for sending the mouse messages WM_LBUTTONDOWN and WM_LBUTTONUP
- NS -
|
|
|
|