|
VivekuniQ wrote: what's a message pump? does it deal with send,post,despatch,etc??
A program's message loop reads any pending message from the message queue and then dispatches that message back to Windows, which then calls your program's window procedure with that message as a parameter. Without MFC, you are responsible for both the message loop and the window procedure. MFC handles this for you.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I got this request from my boss.. :
Are you familiar with writing “message pumps”?
This is where you would “push” and “pop” off of dynamic arrays to control threading of commands to API’s.
Multiple threads can “push” messages onto the message stack using a single locking mutex and one single thread “pops” the messages off of the message stack and sends them to the API (using the same locking mutex).
--------------------------------------
what he means actually?.. yeaa we can send messages to the queue.. using sendmessage,postmessage..but should i go for win32 api ? where these messages would be processed by the wndproc ? but whatz the need for mutex here?
--[v]--
|
|
|
|
|
VivekuniQ wrote: one single thread “pops” the messages off of the message stack and sends them to the API (using the same locking mutex)
whatz this i dont understand.. sends them to the API??
He is like a one-legged man in a bum kicking competition. -Novjot Sidhu
--[v]--
|
|
|
|
|
I'm curious why you are being asked to do something that Windows already does and does well. If you use SendMessage() , control does not return until after the window procedure has processed the message. If you use PostMessage() , control returns immediately.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
i guess he's talking in context with the user defined messages.. i'll get back to you after getting a clear requirement.
thanks.
--[v]--
|
|
|
|
|
VivekuniQ wrote: i guess he's talking in context with the user defined messages..
In terms of how the message is entered into the message queue (SendMessage() vs. PostMessage() ), there is no difference between a user-defined message and a system message. If the default window procedure sees a message it does not care about (e.g., user-defined message), the message is ignored. If your window procedure sees a message it does not care about (e.g., system message), the message is ignored.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
i have an application in which microsoft word is embedded. i want to get the caret position. Here GetCaretPos is not working. Can anybody help me out?
i tried Accessible::g_accLocation also.
-- modified at 9:15 Friday 28th October, 2005
|
|
|
|
|
I have some problem with my printer.The code snippet written below is Writting the Text on the Printer.But i am unable to check this with my machine.Can anyone Paste that code & check whether the Text is printing or not.
Steps to Follow:
1) Create a new Dialog Based Application
2) On the OnOk function paste the below code .
Change the printer name as ur own.
--------------------------------------------------------------------
void OnOk()
{
HANDLE hPrinter;
DOC_INFO_1 DocInfo;
DocInfo.pDatatype = "RAW"; // datatype is Null (it can be EMF also)
DocInfo.pDocName = "Named Document"; // Name of the Dopcument
DocInfo.pOutputFile = NULL; // Output is to the printer
DWORD written; // For the number of bytes written to the printer
char cBuffer[20] = "MyTextBuffer\f";
OpenPrinter("Lexmark 2200 Series",&hPrinter,NULL);//you should change
// the name of the printer
StartDocPrinter(hPrinter,1,(LPBYTE)&DocInfo);
StartPagePrinter(hPrinter);
WritePrinter(hPrintercBuffer,sizeof(cBuffer),&written);
EndPagePrinter(hPrinter);
EndDocPrinter(hPrinter);
ClosePrinter(hPrinter);
}
|
|
|
|
|
Hello,
can body tell me how to send email in VC6 using CDO.
|
|
|
|
|
naeemnimi wrote: using CDO.
What's CDO stands for
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
|
ThatsAlok wrote: What's CDO stands for
Collaboration Data Objects is an object library that exposes the interfaces of MAPI. Because it is based on COM, it is language independent. To collaborate means to work together, especially in a joint intellectual effort, much like Outlook does.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: To collaborate means to work together, especially in a joint intellectual effort, much like Outlook does.
Thats Great
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hello,
I dont know, how to implementate a registration script
"hInstance needs to be the module / instance handle
of the module that contains your server registration
script (resource ID 102) .."
the server registration script is importand to
register my OPC Server.
RegisterServer()
HRESULT RegisterServer(void)
Return Values S_OK upon success, otherwise the result code
returned from the ATL registrar component.
The success of this operation is dependent on the application
including a registry script resource as part of its EXE.
The resource ID MUST be 102. An example resource script
is shown below:
HKCR
{
NDI.SimulationSvr.1 = s 'NDI Simulation Server'
{ CLSID = s '{1E52DE00-FA5E-11d2-91C6-F8E932000000}'
...
Best regards
Thomas
|
|
|
|
|
I'm converting a project from a VC++ ActiveX control to a C++ .net control.
The mouse button handling will change mode so that if left button is pressed on thing happens, right button does something else, and both buttons does another thing. This works OK but after having pressed both mouse buttons and then releasing one of the buttons the control loses capture (Control::Capture returns false). Under ActiveX/COM it didn't behave like this.
I've tried tracking the capture state during the mousedown and mouseup event handlers but still can't see what's going wrong.
Anybody got any ideas?
Thanks,
Dan
|
|
|
|
|
Hello,
Can somebody would tell me how to send email in C++ using smtp.
|
|
|
|
|
naeemnimi wrote: Can somebody would tell me how to send email in C++ using smtp.
here is an example :-
http://www.codeproject.com/internet/csmtpconn.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
http://www.codeproject.com/internet/csmtpconn.asp[^]
The method that the above site provides may be useful to send e_mail on the old smtp protocol servers. This kind of servers dont need the user name and password when they are connected to send e_mail. But now most of the e_mail servers update e-mail system for security and against rubbish e-mails.They ask users to provide user names and passwords to be connected.
to send mail,you should follow:
1、use socket to connect to the smtp server .
2、send "ehlo the smtp server \r\n" to the smtp server . you will receive the "250" from the smtp server,which stands for ok.
3、send "auth login \r\n" .then will receive the "334" from the smtp server.
4、send "your user name\r\n" which is encoded by the base64 arithmetic. you will receive the "334" .
5、send "your password"which encoded by the base64 arithmetic. you will receive the "235" that stands for ok.
6、so much to write.then follow the above site to continue.
libo
|
|
|
|
|
Intertherain wrote: This kind of servers dont need the user name and password when they are connected to send e_mail. But now most of the e_mail servers update e-mail system for security and against rubbish e-mails.They ask users to provide user names and passwords to be connected.
You may Be right.. But I have you this class to send mail to Yahoo and Gmail... I believe two most popular email service of world (if i am not wrong)
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
|
someone told me
g:\programy\microsoft visual studio 8\vc#\.\vc#wizards
is actually the same as:
g:\programy\microsoft visual studio 8\vc#\vc#wizards
is this right
can someone shed more light on this
thanks
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
-- modified at 3:54 Friday 28th October, 2005
|
|
|
|
|
. in a path means 'current folder'.
so, C:\.\.\.\.\myFolder means C:\myFolder...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
The following code is for detect if USB disk is writable, it work well under Win2000, WinXP but not under Win98 where I got ERROR_FILE_NOT_FOUND error. Are these functions' parameters questionable or should I turn to another solution in order to make it work under Win98?
CString strDrive;
strDrive.Format("\\\\.\\%c:", A~Z);
HANDLE hDrive = CreateFile(strDrive, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_NO_BUFFERING, NULL);
DWORD dError = GetLastError();
DWORD dwRet;
BOOL bWritable = DeviceIoControl(hDrive, IOCTL_DISK_IS_WRITABLE, NULL, 0, NULL, 0, &dwRet, NULL);
|
|
|
|
|
This[^] link should give you the information you need. There is link to a 2nd article on how to use DeviceIoControl for early versions of Windows. Since the logic is different, you will also need to determine the operating system you are running under to select the correct logic path.
Steve
|
|
|
|
|
hi,
When u r running in the winXp, the XP gives the driver automatically for the USB device. But in '98 environment user has to give the driver for device. so before accessing the USB device, load the driver for the USB device. This might be problem with this.
Regards,
Parthiban
|
|
|
|