|
Fatally wrong!!!
You can only use CreateService() for normal kernel mode services, but never for WDM drivers. They need additional information in the registry, which can never be set by using CreateService()!!!!!
You can get the information you need here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/setupapi/setup/installing_from_an_inf_file.asp
Don't try it, just do it!
|
|
|
|
|
Hi
You may have solved your problem, but I still like to share this piece of information with you.
http://www.microsoft.com/whdc/driver/install/difxtools.mspx
you can try tye API of microsoft which make driver instalation and Uninstallation very easy and effective.
Regards
Anil
|
|
|
|
|
I have built a cpp project into an exe file. When I run it it just shows for a moment and disappear. How can I make it seen untill i close the app.
Please help
Angalo
Angalo
|
|
|
|
|
|
How are you running it? Is it a GUI or console application? If the former, is it dialog, SDI, or MDI?
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
Hi!
It is a console application. When I run the exe it just shows the conole and immediately disappears.
|
|
|
|
|
Open a command prompt window first, and then run your application from there. It should be fine.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
Angalo wrote: I have built a cpp project into an exe file. When I run it it just shows for a moment and disappear. How can I make it seen untill i close the app.
Please help
Use Ctrl-F5 or put a getch() as the last line in your main function.
Regards,
Nish
|
|
|
|
|
It sounds like you are running your application under the debugger. Place a breakpoint on the last line of code in your application. For a console application, this will be the return statement in the main function.
Software Zen: delete this;
|
|
|
|
|
Hello:
I would like to set a Check-box control to "BST_INDETERMINATE" state, but don't know how.
I have set the "Tri-state" to true in the Check-box control properties.
Please help me with this.
Blakiston
|
|
|
|
|
|
I have built a cpp project into an exe file. When I run it it just shows for a moment and disappear. How can I make it seen untill i close the app.
Please help
Angalo
|
|
|
|
|
If your exe is a console application, add a getch() as the last statement in u r program. Don’t forget to include conio.h.
-- modified at 9:53 Saturday 27th May, 2006
|
|
|
|
|
Can you be more specific
whitesky
|
|
|
|
|
Hello.
I'm trying to figure out how to arrange the following code so that if a user were to enter a movie title, the SQL code in this program can accept a user-entered string and return the results. Right now, if I just put the name 'Vertigo', directly into the SQL code, it works perfect, but if I put the string sMovie into the SQL code, it just crashes the console.
Database name: VideoRental.mdb
Table name: Video
I only have three items in the table to test this code:
PROD_ID PROD_TITLE
10001 Psycho
11002 Vertigo
31001 Hostile
<br />
<br />
#import "c:\Program Files\Common Files\System\ADO\msado15.dll" \<br />
no_namespace rename("EOF", "EndOfFile")<br />
<br />
#include <stdio.h><br />
#include <iostream><br />
using namespace std;<br />
<br />
void main(void)<br />
{<br />
string sMovie = "Vertigo";<br />
<br />
CoInitialize(NULL);<br />
try <br />
{<br />
_RecordsetPtr pRst("ADODB.Recordset");<br />
_bstr_t strCnn("DRIVER={Microsoft Access Driver (*.mdb)};UID=admin;DBQ=VideoRental.mdb");<br />
<br />
pRst->Open("SELECT * FROM [Video] WHERE [Video].[PROD_Title] = 'Vertigo';", strCnn, adOpenStatic, adLockReadOnly, adCmdText);<br />
<br />
pRst->MoveFirst();<br />
<br />
while (!pRst->EndOfFile) <br />
{<br />
cout<<(char*) ((_bstr_t) pRst->GetFields()->GetItem("PROD_ID")->GetValue())<< " ";<br />
cout<<(char*) ((_bstr_t) pRst->GetFields()->GetItem("PROD_TITLE")->GetValue())<< " ";<br />
pRst->MoveNext();<br />
}<br />
system("pause");<br />
pRst->Close();<br />
<br />
system("pause");<br />
<br />
}<br />
catch (_com_error &e)<br />
{<br />
cout<<(char*) e.Description();<br />
}<br />
<br />
::CoUninitialize();<br />
}<br />
|
|
|
|
|
You have to build the command string, using std::ostringstream is the easiest way to do this.
Dreamspeeder wrote: pRst->Open("SELECT * FROM [Video] WHERE [Video].[PROD_Title] = 'Vertigo';", strCnn, adOpenStatic, adLockReadOnly, adCmdText);
std::ostringstream SQLCommand;
SQLCommand << "SELECT * FROM [Video] WHERE [Video].PROD_Title = '" << sMovie << "';" << std::ends;
pRst->Open(SQLCommand.str().c_str(), strCnn, ...
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
HI all...
I'm looking for some good tutorials about develop visual c++ multi thread but with out using MFC.
I try Google but didn't find something really good that explain how to develop multi thread.
Someone can help ?
Thanks
|
|
|
|
|
|
See Here[^] maybe it is some helpful to you
whitesky
|
|
|
|
|
Hey,
I've an application using a CTreeCtrl for navigation. When the user closes the application I want to save the selected item. I cannot use the CTreeCtrl::ItemData because several items hold the same data. Is there any way, to get an ID or a possition of the selected item?
Thanx for your help!
-- modified at 12:15 Friday 26th May, 2006
|
|
|
|
|
not easy
depends tree depth
One approach index.
Kuphryn
|
|
|
|
|
Walk up the nodes to the root building a path object/string whatever you need.
|
|
|
|
|
how can i implinent thereads in MFC what is the header file that i can use if anyone know plz let me know at noumanzaidi@hotmail.com
nomy
|
|
|
|
|
you can start a thread using MFC by calling AfxBeginThread function.
The function (pointer) poassing this function should be static if it is part of a class.
normally we will pass the object pointer to teh function to access the data of the class.
u can also pass global function as thread routine.
the function should prototyped as follows
UINT FxnName(LPVOID pParam )
i think it is better to use CreateThread function instead of calling AfxBeginThread.
See MSDN for more info.
SaRath
|
|
|
|
|
SaRath C wrote: i think it is better to use CreateThread function instead of calling AfxBeginThread.
MFC is not properly initialized for the thread context when CreateThread() is used.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|