|
Hi all,
I have the following problem, I include the following header files:
#include <sql.h>
#include <sqlext.h>
But I receive this error:
[C++ Error] sqltypes.h(123): E2146 Need an identifier to declare
@ line 123 : typedef unsigned long ULONG;
Can anyone help me ??
Many Thanks
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Suggest you do a Google search on "E2146 Need an identifier". It appears to have something to do with the definition of winsock.h vs winsock2.h
hope this helps you.
John P.
|
|
|
|
|
jparken wrote: It appears to have something to do with the definition of winsock.h vs winsock2.h
When why am I receiving the error in my sqltypes.h file ??
Google result:
Results 1 - 10 of about 59 for E2146 Need an identifier.
jparken wrote: hope this helps you.
Thanks
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Looking through those headers I can't see why you'd get that message.
Do you have WIN32 defined (probably in the project settings preprocessor defines)? You should
Also, maybe try including windows.h before those includes, but I can't readily see where that
would make a difference.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
|
But you're using header files from the Windows Platform SDK, right? Or does Borland have
their own version of Windows headers?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
|
That's a library not a header
Take a look through sqltypes.h - does it refer to "WIN32"? What about "HWND"?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Yes, all of the header files are there.
sql.h
sql_1.h
sqlext.h
sqltypes.h
....
....
And all of the states "Microsoft Corporation" at to the top.
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
Mark Salsbery wrote: Take a look through sqltypes.h - does it refer to "WIN32"? What about "HWND"?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
How can I determine what type of media is associated with a letter in Windows?
Example:
A: is floppy,
B: not used,
C: fixed drive,
D: CD-ROM,
etc.
In VC++ 6 please.
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Take a look at GetDriveType() .
|
|
|
|
|
Thank you, very much!
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
hello everybody
i used to do quite a lot of vc a few years
but got a job using another programing lauguage called PReS. (I bet nobody has heard of it)
is vc still the language to learn or would vb.net or c# or somthing else be better
which the most used language these days
jooooe
|
|
|
|
|
Jooooe wrote: is vc still the language to learn...
If you need to.
Jooooe wrote: which the most used language these days
How could anyone possibly know the answer to this?
"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
|
|
|
|
|
If you ask in here you know you're going to get the answer VC++
After all you're not a soft headed newbie who need his memory managed for him are you? Seriously it all depends on what you want to do, how much control you want over how it's done and how quickly you want it done.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Jooooe wrote: which the most used language these days
www.tiobe.com keeps statistics on programming language search engine queries. As Mr. Crow stated, it is unlikely that this will be an accurate representation of what is used most as nobody could possibly know that, but it gives one a picture of how often a person resorts to a search engine query for a particluar language.
One could argue since MSDN is so thorough, that there will be fewer queries from users using Microsoft compilers which would indicate the statistics are probably less than accurate. One could also argue that the statistics merely indicate which languages require secondary assistance to get things done and could simply indicate a flawed help system for the leading compilers of that language.
Beware of buzzword fluctuations as they usually reflect the initial surge of queries to find out what a buzzword technology is. Those tend to taper off after the first year for newer technologies.
|
|
|
|
|
Hi,
This program is a dialog-based MFC application.
My problem is that when I click the "X" in the top right corner of the program to close it, only the window closes, but the process remains running.
I'm not very familiar with MFC (I usually use standard Windows API) so I don't know how to catch the WM_SYSCOMMAND message to handle this. I've tried ON_WM_SYSCOMMAND() in the message map, but I get a compiler error since neither of my two classes are inherited from CWnd objects (one is CWinApp, the other is CDialog).
Does anyone know why my program isn't closing, or how could I catch the WM_SYSCOMMAND message so I could force it to close?
Thanks!
KR
|
|
|
|
|
KellyR wrote: ...but the process remains running.
How are you verifying this? Have you created additional threads?
"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
|
|
|
|
|
The process is still visible in the task manager, and no I only have a single thread.
KR
|
|
|
|
|
How and where is the main dialog created?
BTW, CDialog IS a CWnd
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I thought so too but for some reason I still get a compiler error when I try to map ON_WM_SYSCOMMAND() in my dialog; I guess that's because the BEGIN_MESSAGE_MAP macro ties my class to CDialog and not CWnd? Sorry if I sound like an idiot, I'm just not that familiar with how MFC works. This is the first MFC application I've ever created from scratch so I'm still getting the hang of it.
The main dialog is created in the InitInstance() of the main application.
So something like this:
BOOL CTheApp::InitInstance()<br />
{<br />
CWinApp::InitInstance();<br />
m_MainDlg = new CMainAppDlg();<br />
<br />
if(!m_MainDlg->Create(IDD_MAIN_DIALOG))<br />
{<br />
AfxMessageBox(TEXT("Failed to initialize."), MB_OK, 0);<br />
return FALSE;<br />
}<br />
m_MainDlg->SetWindowText(TEXT("Test Dialog"));<br />
m_pMainWnd = m_MainDlg;<br />
<br />
return TRUE;<br />
}
KR
|
|
|
|
|
What's the compiler error when you add a ON_WM_SYSCOMMAND() entry to the dialog class'
message map?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
The error is this:
error C2440: 'static_cast' : cannot convert from 'void (__thiscall CMainAppDlg::* )(void)' to 'void (__thiscall CWnd::* )(UINT,LPARAM)'
KR
|
|
|
|
|
Your handler function needs to be declared as
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
From the error message it looks like you have void OnSysCommand();
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|