|
Hello,
I don't have vc++ documentation with me on my PC.From where can I download it .Is there any link
Prithaa
|
|
|
|
|
Try and use MSDN Library. I didn't find anything better than this.
Anurag Gandhi.
|
|
|
|
|
Thanks Anurag
I will do that
Prithaa
|
|
|
|
|
hye,
I m new to VC++
i wrote a simple program in VC++
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
{
bool InitInstace();
};
Bool CApp :: InitInstance()
{
m_pMainWnd=new MainWin;
m_pMainWnd ->ShowWindow(m_nCmdShow);
m_pMainWnd ->UpdateWindow();
return true;
}
Begin_Message_Map(CMainWin,CFrameWnd)
End_Message_Map()
CApp App;
but i m gtng two errors
1) syntax error : missing ';' before type 'long'
2)fatal error C1004: unexpected end of file found
Neha
|
|
|
|
|
Use:
#include "stdafx.h"
and then try.
for all string, write: _T("") instead of "".
For example, write _T("Hello") instead of "Hello".
I think this will help.
Anurag Gandhi.
|
|
|
|
|
what u suggested is not working (stdafx.h)
also,i m using create function then how to use :
_T("Hello") instead of "Hello".
neha
|
|
|
|
|
Whats header file of your program ?
|
|
|
|
|
Dear Neha,
One thing is that, your project might have enabled precompiled header. So that you have to include stdafx.h in your project or remove the pre-compiled header setting for the file from project properties.
Declare_Message_Map() is actually DECLARE_MESSAGE_MAP() hope you are aware about this. Please put the right source code and complete error message to get your problem solved.
I think you can approach Visual C++ Create Simple SDI for you.
I doubt your "Create" function will succeed because you have to give a valid class name for the window.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Still not working
any other clue???????
pls help me out
neha
|
|
|
|
|
Please post the correct code and error messages.
Are you dealing everything in a single CPP file?
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
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
|
|
|
|