|
|
white jungle wrote:
I don't know what is meaning of error message
Preprocessor commands (such as #include and #define) must be the first thing on the line. You can have spaces/tabs in front of them, but nothing else.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
<br />
#include "StdAfx.h"<br />
#include "DbControl.h"<br />
<br />
#ifdef _DEBUG<br />
#define new DEBUG_NEW<br />
#endif<br />
<br />
CDbControl::CDbControl(void)<br />
{<br />
m_pConn=NULL;<br />
m_pRs=NULL;<br />
m_pConn=new CADOConnection();<br />
ASSERT(m_pConn!=NULL);<br />
}<br />
CDbControl::~CDbControl(void)<br />
{<br />
if(m_pConn)<br />
{<br />
delete m_pConn;<br />
m_pConn=NULL;<br />
}<br />
}<br />
............<br />
Here is my code,and you can see nothing beafore the number sign'#'
Don't look at me in that way!
|
|
|
|
|
Try deleting everything up to and including the stdafx.h include, then rewrite that include, and finally do a clean and rebuild all. Then search your entire project for #, to see if the problem is elsewhere, if need be.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
and how about into the files you include (stdAfx.h and DbControl.h) ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
What line is the preprocessor complaining about?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I need to send keys to a application's UI. I looked at some of the examples, but I was hoping someone might have some more examples.
|
|
|
|
|
|
Would you help me?
How can I get the information about the access control of a Map Network Driver?The information includes read only or write only and so on.
Thanks.
|
|
|
|
|
For a C++ Programming Class (e.g. course in school) i have to make a simple simulation of a mouse that is trapped on an island and runs eradicly till it escapes or dies from drowning/starvation. for this project i was building a class (e.g. abstract dat type) to represent the square of land
<code>
#ifndef SQUARE_H
#define SQUARE_H
#include <iostream>
#include <windows.h>
using std::ostream;
enum DONS_SQUARE_TYPE {LAND, WATER, BRIDGE};
class square
{
public:
typedef DONS_SQUARE_TYPE type;
square(type = LAND);
bool isWater() const;
private:
type myType;
};
ostream& operator<< (ostream& ,square&);
#endif
<code>
is there any way by which i could not have to have DONS_SQUARE_TYPE floating around the global namespace but still have that constructor?
I tried doing a:
<code>
typedef enum {LAND, WATER, BRIDGE} type
<code>
but then i get 3 compiler errors saying undeclared identifier (LAND / WATER / BRIDGE) for the code:
square landS(LAND),
waterS(WATER),
bridgeS(BRIDGE);
please help, thanks.
|
|
|
|
|
You can define an enum inside a class. There's no need to typedef it - it's a type in it's own right.
|
|
|
|
|
but wont the enum's members (for lack of a better word) still be considered undeclared identifiers outside of the scope of the class?
|
|
|
|
|
Yes, but you can include the class scope operator to reference them from outside the class:
<br />
class square<br />
{<br />
enum squareType{LAND, WATER, BRIDGE};<br />
square(squareType type);<br />
};<br />
<br />
square a(square::LAND);<br />
square b(square::WATER);<br />
<br />
You can see an example of this in the MFC CFile class's open flags - CFile::modeCreate, CFile::modeWrite, etc.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
Hi,
I try to kill a dialog(CPropertySheet) in a friendly way
and need to do this from another thread.
I've tried using PostMessage etc...
and EndModalLoop, EndDialog...
But nothing seems to be working for me.
Any tip would be appreciated.
Koo
|
|
|
|
|
hi
Take the handle of your dialog and then pass that handle to the EndDialog(). or you can try out this
Enddialog(1)
cheers
jhon
|
|
|
|
|
no no no, EndDialog() gets as parameter the value the dialog would return...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Sending messages to the PropertySheet does work. But you need its pointer of course.
pSheet->SendMessage(WM_CLOSE,0,0);
and
pSheet->SendMessage(WM_COMMAND,IDOK,0);
It seems to work fine.
this is this.
|
|
|
|
|
Thanks! The WM_COMMAND message did the job!
"There is an empty room full of people who think you are creative"
|
|
|
|
|
How to include files inside an .exe file and when it runs it will extract them?
thanks in advance
|
|
|
|
|
|
See if this article helps.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thanks alot for your replaies, they helped alot.. thanks again : )
|
|
|
|
|
Hi,
Can anyone tell me how Fast User Switching (using Windows XP) can be implemented in VC++? Or even suggest how it might be done?
Thanks very much,
dlarkin77
|
|
|
|
|
I am trying to retrieve the file summary information but keep receiving File not found. I have tried this on two different boxes. Can anyone suggest a reason for the failure? Can we agree the file is where I say it is?
Thanks so much in advance
Anthony Baker
awwbaker@yahoo.com
void CFileSummary::ExtractFileSummary(LPCSTR pFileName)
{
IStorage *pStorage = NULL;
IPropertySetStorage *pPropSetStg = NULL;
HRESULT hr;
WCHAR wcFilename[1024];
setlocale( LC_ALL, "" );
int i = mbstowcs(wcFilename, pFileName, strlen(pFileName));
setlocale( LC_ALL, "C" );
wcFilename[i] = 0;
hr = ::StgOpenStorage(wcFilename,
NULL,
STGM_READ | STGM_SHARE_EXCLUSIVE,
NULL,
0,
&pStorage);
// CMT: If its not the compound file
if (FAILED(hr))
{
hr = StgOpenStorageEx(wcFilename,
STGM_READ | STGM_SHARE_DENY_WRITE,
STGFMT_FILE,
0,
NULL,
NULL,
IID_IPropertySetStorage,
reinterpret_cast<void**>(&pStorage));
}
// [CMT]: Obtain the IPropertySetStorage interface.
hr = pStorage->QueryInterface(IID_IPropertySetStorage, (void **)&pPropSetStg);
// [CMT]: Dump properties.
DumpBuiltInProps(pPropSetStg);
// [CMT]: Release obtained interfaces.
pPropSetStg->Release();
pStorage->Release();
}
void CFileSummary::DumpBuiltInProps(IPropertySetStorage *pPropSetStg)
{
IPropertyStorage *pPropStg = NULL;
HRESULT hr;
// Open summary information, getting an IpropertyStorage.
hr = pPropSetStg->Open(FMTID_SummaryInformation, STGM_READ | STGM_SHARE_EXCLUSIVE, &pPropStg);
if(FAILED(hr))
{
printf("No Summary-Information.\n");
return;
}
|
|
|
|
|
Can you first check what PathFileExists returns?
Geert
Want to spread the newest version of your software automatically? Use Updater!
Visit my website: http://geert.yoki.org
|
|
|
|