|
Have you tried displaying the csSql string with a message box and verified that the SQL statement is perfect before executing it on the DB?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
includeh10 wrote: " STRING_0 = \'hello\', "
" TIME_0 = \'02/30/2008 12:5:7\'"
" where"
Max. possible day value of February 2008 is just 29 together with a leap year. Feb. 30 is an invalid date (02/30/2008).
|
|
|
|
|
hi friends!
i have included one activeX control in my MFC dialog project, through Project-->Add to Project-->Component & controls. and its appeared in the toolbox.
is it possible to remove that control from the toolbox? if yes how, no means why?
because my system is getting dead slow to compile the project ones i have include the ActiveX control. (e.g. MSFlexGrid).
please let knw the answer as soon as possible..
thanks in advance..
truly
AK
|
|
|
|
|
Did you right click the control on the ToolBox?
|
|
|
|
|
Khathar wrote: i have included one activeX control in my MFC dialog project, through Project-->Add to Project-->Component & controls. and its appeared in the toolbox.
It shows you are using VS 6.0 or lower (than 2005)
Khathar wrote: is it possible to remove that control from the toolbox? if yes how, no means why?
1) no, it is the issue with VS [PRB: Can't Remove Controls from the Controls Toolbar in VC++^], go for higher IDE like 2005 or higher it supports easy UI for that.
2) yes, but manually [How to remove a Toolbox component, an OLE Control, or a Component Gallery component from a Visual C++ project
^]
Khathar wrote: (e.g. MSFlexGrid).
remove all the files created (font1.(cpp & h) msflexgrid.(cpp & h) picture1.(cpp & h) rowcursor1.(cpp & h) remove any dependency with other classes like message handlers)
delete or backup your *.dsw file and edit your *.dsp file to remove the sections
# Section <project name> : {7BF80981-BF32-101A-8BBB-00AA00300CAB}
# 2:5:Class:CPicture
# 2:10:HeaderFile:picture1.h
# 2:8:ImplFile:picture1.cpp
# End Section
# Section <project name> : {9F6AA700-D188-11CD-AD48-00AA003C9CB6}
# 2:5:Class:CRowCursor
# 2:10:HeaderFile:rowcursor1.h
# 2:8:ImplFile:rowcursor1.cpp
# End Section
# Section <project name>: {6262D3A0-531B-11CF-91F6-C2863C385E30}
# 2:21:DefaultSinkHeaderFile:msflexgrid1.h
# 2:16:DefaultSinkClass:CMSFlexGrid
# End Section
# Section <project name>: {5F4DF280-531B-11CF-91F6-C2863C385E30}
# 2:5:Class:CMSFlexGrid
# 2:10:HeaderFile:msflexgrid1.h
# 2:8:ImplFile:msflexgrid1.cpp
# End Section
# Section <project name>: {BEF6E003-A874-101A-8BBA-00AA00300CAB}
# 2:5:Class:COleFont
# 2:10:HeaderFile:font1.h
# 2:8:ImplFile:font1.cpp
# End Section
now re load the *dsp and allow the IDE to create fresh *dsw
Khathar wrote: because my system is getting dead slow to compile the project ones i have include the ActiveX control.
Are you sure compile time is because of this, please have a look at [reducing Compilation time^]
|
|
|
|
|
where to add the code for status bar if i need to use it in dialog other than the main dialog,they don't have a OnInitDialog()function in them
RAJA
|
|
|
|
|
|
i did see the coding given in that link,but my question was where should i do it in the newly created dialogs,they don't have a OnInitDialog(...)....so where should i put this code
m_bar.Create(this);
m_bar.SetIndicators(indicators,2);
CRect rect;
GetClientRect(&rect);
m_bar.SetPaneInfo(0,ID_INDICATOR_NISH,
SBPS_NORMAL,rect.Width()-100);
m_bar.SetPaneInfo(1,ID_INDICATOR_TIME,SBPS_STRETCH ,0);
RepositionBars(AFX_IDW_CONTROLBAR_FIRST,AFX_IDW_CONTROLBAR_LAST,
ID_INDICATOR_TIME);
RAJA
|
|
|
|
|
Hi,
U can only do it in the OnInitDialog(). The OnInitDialog is similar to OnCreate. So u need to place your code inside the OnInitDialog of the dialog in which u wanted place the Status bar.
thanks
Nitheesh
|
|
|
|
|
I need to add the status bar in this dialog,but i don't have a onInitDialog(),so where should i add the code????????
IMPLEMENT_DYNAMIC(autoscan, CDialog)
autoscan::autoscan(CWnd* pParent )
: CDialog(autoscan::IDD, pParent)
{
}
autoscan::~autoscan()
{
}
void autoscan::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
}
BEGIN_MESSAGE_MAP(autoscan, CDialog)
ON_BN_CLICKED(IDOK, &autoscan::OnBnClickedOk)
ON_LBN_SELCHANGE(IDC_LIST2, &autoscan::OnLbnSelchangeList2)
END_MESSAGE_MAP()
void autoscan::OnBnClickedOk()
{
OnOK();
}
void autoscan::OnLbnSelchangeList2()
{
}
RAJA
|
|
|
|
|
If you want to make status bar when you clicked a button you can put your code on that function,now where's problem?
|
|
|
|
|
OnInitDialog is an override, why don't you add this to the autoscan class.
Use can use Class View to add this override, class view -> autoscan class property->overrides: OnInitDialog.
or manually override the function
header file
class autoscan: public CDialog
{
...
public:
virtual BOOL OnInitDialog();
};
cpp file
BOOL autoscan::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
|
|
|
|
|
Project RAJA wrote: ...newly created dialogs,they don't have a OnInitDialog...
They all do. Why would you think otherwise?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I am developing an application which hooks the common dialog WIndow. I wanted to send a message to the common dialog to make a force redraw of the window. I used PostMessage API to post a message to the queue but it does not work for Child Window. How can i send a message to a child Window without using the SendMessage API.
thanks
Nitheesh
|
|
|
|
|
|
Yes SendMessage Works fine. But i want to Post Message to the Queue.
|
|
|
|
|
Nitheesh George wrote: I used PostMessage API to post a message to the queue but it does not work for Child Window. How can i send a message to a child Window without using the SendMessage API.
if sendmessage work, post message ought to work. try putting breakpoint in MessageHandller function to check when it recv the postmessage request
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
Hello,
I have made client server communication and I am sending and recieving Files.
I am using file pointer and fread and fwrire commands to read and write file.
I am able to read and write .txt,.GIF files.but I could not write .doc file.
I am opening file in binary mode only.
I am reciveing file with same size as I sent. but after opening .doc file I got an error that "word was unable to read the file".
can any one tell me what might be the reason behind that?
do I need any special code to read and write .doc file?
Thank You...
vijay.
|
|
|
|
|
have you tried with file compare tools like windiff.
|
|
|
|
|
vijay_k wrote: can any one tell me what might be the reason behind that?
Only CP members with superpowers and the CPMRU (Code Project Mind Reader Unit) turned ON.
vijay_k wrote: do I need any special code to read and write .doc file?
No. But you have to make sure that the transferred file is identical to the original one. You may use a tool such a Windiff to verify it.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I tested it with windiff.
I am getting message that created file is more recent.
I am not getting what can be done next?
Here I am giving You code for writing that file.
if( nFile != NULL )
{
numwritten = fwrite( recvbuf, sizeof(char),length, nFile );
fclose(nFile)
}
else
MessageBox(NULL,"Problem opening file",NULL,NULL);
Do I need to use feof or any other commands?
Thank You...
Vijay.
|
|
|
|
|
vijay_k wrote: I am getting message that created file is more recent.
That's ok.
Now, what about the differences? Can you see any difference (using Windiff, select the first item and then click the expand button)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I expanded it and I got some Encrypted language contents.
but on clicking on edit right file and left file I got .txt file version of both files.
There is a differeence in both files.The half of the file is same and I am getting "ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌ" charachters for rest of file(in created file).
I am not getting why there is such difference.
Thank You....
Vijay.
|
|
|
|
|
Probably the buffer you're writing to the output file does not contain the whole info. I think you have to check how many bytes are actually transferred between the client and the server.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Before I sent contents of file I am sending the length or size of file.
And I am recieving lenght of file.
I am using that length in recv() function.
It is working fine for .gif file.
Thank You...
Vijay.
|
|
|
|