|
Have a look at ShellExecuteEx [^] or system [^].
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.
|
|
|
|
|
Look up the following functions as well as ones related/similar to them:
system(...)
ShellExecute(...)
CreateProcess(...)
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
even though i could give you the answer to this, i won't for 2 reasons :
1), if you can't search the msdn for how system() works, why should i bother using my time for ya...?
2) system() is generally deprecated if you code for windows plateforms only. you should prefer using ShellExecute() instead
|
|
|
|
|
Hi all,
I would like to create a library in vc++ which will supports folowing databases like Mysql,postgresql,oracle,sqlserver to connect the database,create new database,insert records,delete records......
Is it possible? if yes, please give me your suggestions and any useful tutorials
thanks in advance
|
|
|
|
|
There already is one - it is called ODBC... Try Googling for ODBC [DatabaseNameHere] , like ODBC MySQL , ODBC Postgresql , etc.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
For start you must know more detaily of databases so I suggest see Database articles[^] on the codeproject.
|
|
|
|
|
|
|
why a static member function has no this pointer?
KIRAN PINJARLA
|
|
|
|
|
Because is a class method rather than a instance method .
The concept is quite similar to static variable of classes (but the latter is, IMHO, more immediate): if you declare
class A
{
public:
static int iShrd;
};
then iShrd is a class variable , i.e. is variable shared among all the instance of class A (strictly speaking, you don't even need an instance of the class to access the var, you can use A::iShrd to the pourpuse). As stated before, to understand static functions you can take a similar point of view.
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.
|
|
|
|
|
Hi Kiran,
The calls to a non-static member function gets expended by the compiler and it passes the pointer to the "instance" as an extra parameter named "this".
In case of static member function, the instance is not available and hence compiler does not make any modification for these functions to accomodate "this".
Manoj
Never Give up
|
|
|
|
|
I am trying to run a 16-bit application by calling the CreateProcess function. I have played with all sorts of parameters' combinations but it keeps failing.
When I call:
STARTUPINFO si;
ZeroMemory(&si, sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_SHOWNORMAL;
PROCESS_INFORMATION pix;
BOOL b = CreateProcess(_T("d:\\path\\app.exe"),
NULL, NULL, NULL,
FALSE, 0 , NULL, NULL,
&si, &pix);
DWORD dw = GetLastError(); the dw value will be 2 (ERROR_FILE_NOT_FOUND, which is not the case).
Do you know the workaround?
|
|
|
|
|
Bogdan Rechi wrote: Do you know the workaround?
There is no workaround, CreateProcess functions correctly.
led mike
|
|
|
|
|
led mike wrote: CreateProcess functions correctly
Define "correctly"...
|
|
|
|
|
|
|
Isn't that an endless loop?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Obviously, CreateProcess is an impecably written API function. I was not going to quarrel on this issue at all
Thank you for the advice. Unfortunately, where I am right now, it is not possible to do the test. I remember that I did it earlyer today with little success but I will double-check it on Monday, just in case.
|
|
|
|
|
Bogdan Rechi wrote: Obviously, CreateProcess is an impecably written API function
I hope so....I rely on it.
No argument here, just trying to provide a possible solution to something I can't reproduce
here
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Bogdan Rechi wrote: ERROR_FILE_NOT_FOUND, which is not the case
Are you absolutely sure the pathname is specified correctly?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Positive. I can copy-paste it and run it from the console.
It's the Pascal-FC compiler (http://www-users.cs.york.ac.uk/~burns/pf.html[^]) for Windows 2000 (and newer). A small tool for solving theoretical multithreading problems I am trying to build a GUI for...
|
|
|
|
|
Then you need to do this:
BOOL b = CreateProcess(NULL, _T("d:\\path\\app.exe"), NULL, NULL,FALSE, 0 /*CREATE_SEPARATE_WOW_VDM*/, NULL, NULL,&si, &pix);
"If the executable module is a 16-bit application, lpApplicationName should be NULL, and the
string pointed to by lpCommandLine should specify the executable module as well as its arguments."
Make sure you quote the pathname if there's any spaces in it.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Bogdan Rechi wrote: BOOL b = CreateProcess(_T("d:\\path\\app.exe"),
Is the path correct?
Bogdan Rechi wrote: Do you know the workaround?
There's nothing wrong with the code snippet you've provided.
"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
|
|
|
|
|
I've just run the same code on an old Win' 98 system and, indeed, it works perfectly.
It seems that it only fails under the Win' XP...
|
|
|
|
|
Using CreateProcess as documented[^] for 16-bit applications didn't help any?
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|