|
what statments in VC++ are used to commit a transaction in database in code?plz tell.
|
|
|
|
|
you didn't answer the question by toxcct.
How do you write to database??
BTW: which database are you using??
Regards,
Sandip.
|
|
|
|
|
C++ knows nothing about databases.
you certainly installed a C++ driver to access your DB, which brings you some classes you can use in your code to query and/or update records.
my first question wasn't clear enough ?
HOW do you write/read to/from your DB ?
|
|
|
|
|
Abhinay Kumar wrote: how to do this in VC++ code?
If a rollback/commit operation is not an option, write to a temporary table instead. If the download is successful, move the contents of the temporary table to a permanent table.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
many spiders in the web ,
if u put open your email get ready for spam .
(not a restriction/requirement of this forum )
Vikas Amin
UNITED STATES STEEL CORPORATION
My First Article on CP" Virtual Serial Port "[^]
modified on Thursday, July 24, 2008 5:33 PM
|
|
|
|
|
Is it possible to set the debug info option through batch build script.
Note: I am not looking for the option through Visual Studio IDE
|
|
|
|
|
|
Thank you Mark. The links are very useful.
|
|
|
|
|
Hi there,
I want to create a button at run-time.
I have a dialog, derived from CDialog, of course.
I can add a CButton data member to my dialog class, for exmaple:
CMyDlg : CDialog
{
CButton btn;
}
and then
CMyDlg::OnInitDialog()
{
btn.Create (.....);
}
this will work.
My question is why can't I declare my CButton inside OnInitDialog (with no pointers) and have it work.
like:
CMyDlg::OnInitDialog()
{
CButton btn;
btn.Create (.....);
}
why? what is the difference? as a data member, CButton is not constructed either, so why is that?
Thanks a lot!
|
|
|
|
|
itaymaor wrote: why? what is the difference? as a data member, CButton is not constructed either, so why is that?
This is because, when the OnInitDialog() function returns, the destructor of the CButton will be called. And in the destructor, there is code to destroy the window.
|
|
|
|
|
Why you dont want to delcare it global?
|
|
|
|
|
itaymaor wrote: I can add a CButton data member to my dialog class
And that would be the appropriate place to do so
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am using waitableTimmer to keep the UI active, during a very length call. Progress bar is working fine, but UI is Frised pls suggest me some good idea for this,
<pre>
HANDLE timer = CreateWaitableTimer(0,false,0);
LARGE_INTEGER li;
const int unitsPerSecond=10*1000*1000;
li.QuadPart=-(2*unitsPerSecond);
SetWaitableTimer(timer,&li,350,0,0,false);
_beginthreadex(0,0,TF,(void*) timer,0,0);
unsigned __stdcall TF(void* arg)
{
HANDLE timer=(HANDLE) arg;
while (1)
{
if(iStoped==0)
return 0;
WaitForSingleObject(timer,INFINITE);
prgBar->StepIt();
DoEvents();
}
_endthread();
return 0;
}
void DoEvents()
{
MSG oMSG;
while(::PeekMessage(&oMSG, NULL, 0, 0, PM_NOREMOVE))
{
::TranslateMessage(&oMSG);
::DispatchMessage(&oMSG);
}
}</pre>
|
|
|
|
|
You're running the message pump in another thread and not the UI thread. Message pumps are thread specific so it's not surprising that your code doesn't work.
Steve
|
|
|
|
|
how to create a translucent rectangle?
thanks.
regards,
tctan
|
|
|
|
|
|
You could use GDI+ and draw using an ARGB color. Adjust
the alpha value to the amount of "translucency" you want.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I need help on Rich edit control. I have placed it in the dialog box and I called the function AfxInitRichEdit() in InitInstance.
I have opened the properties of RichEdit and Checked the Button “Numbers” so that it can accept numbers only. But still it accepts characters ? Why ?
Can anyone help me on this ?
Thanks in advance!!!!
Thanks a lot
|
|
|
|
|
Hello friends,
I've an application that calls the webservice to upload file on server.
I've used MSSOAP toolkit 3.0, everything works fine for Windows XP.
The same code fails under Vista the code is as below.
ISoapConnectorPtr Connector;
hr = Connector.CreateInstance(__uuidof(HttpConnector));
if(hr != S_OK)
{
strErrMessage="Can't create Http Connector.
}
Connector->Property["EndPointURL"] = QPTLOGIN_URL;
hr = Connector->Connect();
In the code above hr = Connector.CreateInstance(__uuidof(HttpConnector)); fails on Vista and working fine in XP.
Can anybody please help me to solve this problem for Vista or any suggestions for calling webwservice in Vista OS.
Thanx in Advance.
ritz1234
|
|
|
|
|
How to work this out?
#ifdef SOME_DEF
#include "stdafx.h"
#endif <------------------------unexpected endif??
chesnokov
|
|
|
|
|
you're not supposed to include stdafx.h conditionnally...
this header which you'll find in any MFC program must be included before any other includes in every compilation unit.
I believe you'll have to disable precompiled headers to have a better try, but even that, I'm not sure it will work.
why are you trying to do that ?
|
|
|
|
|
I want the cpp file to be VS independent. There are no stdafx.h in Builder C++, and the rest. Only in VS. So you need to either use stdafx.h in every cpp or not to use it
chesnokov
|
|
|
|
|
actually, stdafx.h is not mandatory if your application is not linked to MFC.
also, as I already stated, try to disable Precompiled Header.
|
|
|
|
|
it is linked to MFC, the GUI, but the pure C++ lib is not, so you have to put to OS independent lib cpps that stdafx.h
chesnokov
|
|
|
|
|
then, why don't you just gneerate your lib in a non MFC linked DLL ?
that way, your GUI (which is using MFC) will still use stdafx.h like it was, and in your lib sources, you can remove every reference to that file...
|
|
|
|