|
how shall i add a button to IE toolbar using VC++. as givent in the following link.
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/ext/tutorials/button.asp
plz help me..
ComputerNewton
|
|
|
|
|
How to change the description of an service shown in SCM
|
|
|
|
|
SC_HANDLE hSCM;
hSCM = OpenSCManager(
NULL,
NULL,
SC_MANAGER_ALL_ACCESS
);
if(hSCM==NULL)
{
LOGERROR("ERROR opening SC manager");
}
SERVICE_DESCRIPTION sd;
sd.lpDescription=sDescription;
SC_HANDLE hService=OpenService(hSCM, "My Service", SERVICE_ALL_ACCESS);
ChangeServiceConfig2(hService, SERVICE_CONFIG_DESCRIPTION,&sd);
CloseServiceHandle(hService);
CloseServiceHandle(hSCM);
It's not a bug, it's an undocumented feature. suhredayan@omniquad.com
messenger :suhredayan@hotmail.com
|
|
|
|
|
I'm starting work on an MFC-based MDI project (does not use document-view architecture). If completed, it will employ some three dozen view classes, each consisting of 2 or more dot-CPP/dot-H pairs. This will make the project space somewhat crowded.
I was thinking of organizing the view-class files in static libraries, to reduce clutter and increase comprehensibility of the workspace.
Can anyone comment on this? Is there a better way?
Thanks, RD
|
|
|
|
|
I have been using the following section of code to send data to COM1:, but keep getting the error 87 = 'Incorrect function' when I send data to the port.
Note I have setup the device as a generic text printer and that works OK.
Code Listing:-
DWORD cbWritten; // No of bytes written
char mystring[255]; //string variable
int len; //Init the len variable for use of sizing our string
int error;
//set the handle for the CreateFile function
HANDLE hCom = CreateFile( "COM1:",GENERIC_WRITE | GENERIC_READ ,0, 0, OPEN_EXISTING, 0, NULL);
//Init the settings for the DCB (device control block) structure
DCB dcb; //Init the device control block
dcb.BaudRate = 300; //set baud rate
dcb.ByteSize = 8; //Set Bytes
dcb.Parity = NOPARITY; //Set Parity
dcb.StopBits = ONESTOPBIT; //Set stop bit
dcb.fTXContinueOnXoff=TRUE; // XOFf Sent Does Not Stop trans
dcb.fOutX=FALSE; // No Xon/Xoff on Output
dcb.fInX=FALSE; // No Xon/Xoff on Input
dcb.fErrorChar=FALSE; // No error Char in Parity Error
dcb.fNull=FALSE; // Accept Null Characters
dcb.fRtsControl=RTS_CONTROL_DISABLE; // No RTS Flow Control
dcb.fDtrControl=DTR_CONTROL_DISABLE; // No DTR Flow Control
dcb.fAbortOnError=FALSE; // Do Not Abort on error
//Set the port state
error = SetCommState(hCom, &dcb);
if(error != 0)
{
printf("Error Sending Data %d \t", GetLastError());
DisplayErrorText(error);
}
else
printf("State Set OK \n");
//get and size what's gotten
printf("Enter string: ");
gets(mystring); //Get input from keyboard
len = strlen(mystring); //get true length of string
//Output to the com port
error = WriteFile(hCom, mystring, len, &cbWritten, NULL); //write mystring to port
if(error != 0)
{
printf("Error Sending Data %d \t", GetLastError());
DisplayErrorText(error);
}
error = WriteFile(hCom, "\r\n", 2, &cbWritten, NULL); //write return and newline to port
if(error != 0)
{
printf("Error Sending CR/LF %d \t", GetLastError());
DisplayErrorText(error);
}
if(FlushFileBuffers(hCom) == 0)
{
printf("Faied To Flush Buffers \n");
}
printf("Enter Key to Close: ");
gets(mystring); //Get input from keyboard
CloseHandle(hCom); //close the handle
return 0; //exit
|
|
|
|
|
BOOL WriteFile(...) where if COM sending is successful return TRUE otherwise FALSE.
Change: if(error != 0) into if(error == FALSE) and read cbWritten to checkout numbers of characters that COM send.
if(cbWritten != len)
...
|
|
|
|
|
OK thanks, now getting the data through, but only when the program exits.
|
|
|
|
|
http://www.codeproject.com/system/serial_com.asp for more details.
|
|
|
|
|
get the number of records in an array of data structure after reading in a binary file?
|
|
|
|
|
How you read the array from the file?
Robert-Antonio
"Science is a differerntial equation.
Religion is a boundary condition."
|
|
|
|
|
number of bits in files divide with size of one structure.
|
|
|
|
|
i want to connect Oracle database inserver.and install Oracle client in my PC.how can i connect the database with ADO(not using ODBC)
|
|
|
|
|
sConnString = _T("Provider=MSDAORA;Data Source=MyOracleDB;User Id=myUsername;"
"Password=myPassword;");
It's not a bug, it's an undocumented feature. suhredayan@omniquad.com
messenger :suhredayan@hotmail.com
|
|
|
|
|
i used CAsyncSocket class in my prog.when the socket connect.connect()function return zero.getlasterror() show the errorcode is 997.
what is this error?and how can i resolve it?
|
|
|
|
|
tank1025 wrote:
what is this error?
Overlapped I/O operation is in progress.
tank1025 wrote:
how can i resolve it?
something is still going on the port, are you sure nothing else is using the same port.
it might help if you post some code
i can't even remember what my point is now, but anyway, i'm correct
Barring unforeseen acts of God and Adminstrators, my server will be up tomorrow. I'm more worried about the Adminstrators.
|
|
|
|
|
I didn't know where else to put this, so I thought here was the best.
Does anyone know where to find a good algorithm for insertion into a 234 tree?
A thread in time is worth....two....in the bush.
|
|
|
|
|
Hey guys,
I've been looking for hours for a nice DCT implementation... without success.
I need some code which is not too difficult because I don't want to use code I don't understand. Who knows an implementation? Thx for advice.
Don't try it, just do it!
|
|
|
|
|
Fast and easy to read in the same sentance as DCT , good luck!
Try 'Numerical Recipes in C', you can download free chapters from http://www.library.cornell.edu/nr/bookcpdf.html[^] It might take you a little digging to find something appropriate but it should be in there.
If you need something really fast you can try IPP - Intel Performance Primitives (I think that's right) which has great performance, but it isn't open source. I've noticed that some of Intel's libraries (especially OpenCV) are very performance oriented, with little regard for readability.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Do the MS CRT wide string functions, like wprintf, _vsnwprintf, etc, work OK in Windows 98? I know that there is no unicode version of the core Win32 API (unless you have that recent unicode services DLL installed), but I am unclear about the CRT stuff. MSDN seems to imply that they are OK to call.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
The CRT has its own routines that are not depending on the system, so it should work. try it!
Don't try it, just do it!
|
|
|
|
|
I don't have Windows 98 at the moment, and to try ai Have to go through the hassle of installing it via VMWare, so I thought I'd ask first.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
|
|
|
|
|
Hi
I am opening the ChttpConnection Session with CInternetSession.But when i send the Request using the Function
pHttpFile->SendRequestEx(dataLength)
It gives the error "The server name or address could not be resolved" error number is 12007.But i am unable to find any thing on the web. Can anybody help me in this.
Thanks in advance
shailesh
|
|
|
|
|
seems there is an error in the server name passed when creating CHttpConnection.
can you send more code to let us check it with you ?
|
|
|
|
|
change this line :
pHttpConnection = pHttpSession->GetHttpConnection(szAddress, nPort);
to :
pHttpConnection = pHttpSession->GetHttpConnection(strServerName, nPort);
|
|
|
|
|
Hello, I am new to posting on forums so please explain this posting if I am not making any sense. I researched Office Automation on this website and found many useful articles. The most useful was the "Building an Office2K COM addin with VC++/ATL" article by Mr. Dey. I have a dll that is used for MS Word Automation. I put a button on the toolbar which saves whatever is typed in and quits the application. I have a problem, though, after about the 3rd or 4th time of entering MS Word, MS Word will crash. I have isolated the crash to the invoke statement for the Quit:
//Invoke the Quit method
szFunction = OLESTR("Quit");
hr = m_spApp->GetIDsOfNames(IID_NULL, &szFunction, 1,
LOCALE_USER_DEFAULT, &dispid_Quit);
hr = m_spApp->Invoke(dispid_Quit, IID_NULL, LOCALE_USER_DEFAULT,
DISPATCH_METHOD, &dpNoArgs, NULL, NULL, NULL);
I am not sure what the problem is. I found an article on MSDN that has this exact same code. So why would the Invoke GPF? Could it be that I am missing the Release statements (m_spApp->Release)? I modeled my dll after the example in the article "Building an Office2K COM addin with VC++/ATL" so m_spApp is actually a private member in the .h file. HELP!
|
|
|
|