|
|
Is it possible to read data from the transmit and receive buffer of serial port. I'll be sending some data to the Tx line and the hardware will be sending response to the Rx line. How can I monitor both the data from the Tx & Rx line. We'll be using the same port to write to Tx line and monitor both lines. Is it possible ?
|
|
|
|
|
Have a look at PortMon[^].
PortMon will log all IRP's to the driver and the data sent/received.
--
Roger
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998 "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above
|
|
|
|
|
Its not possible to read and write from the COM port at the same time, only one operation is supported at one time.
Gas prices suggest that they have taken out lead from gas and replaced it with gold
|
|
|
|
|
Can I monitor immediately after writing to the port..Can I read data from the Tx line.
|
|
|
|
|
By using GetModuleFileName() in MFC gives exe path of the application,
But in ATL also gives exe path of the Explorer(like c:\windows\explorer.exe)
But now i want if am running the application from d or e drivesit will give drive D or E
plz help me out
|
|
|
|
|
|
for exam my application is at D:\Work\ATLApplication,
Now i want retrive the drive D, through my ATLapplication
|
|
|
|
|
Don't use NULL as the first argument to GetModuleFileName() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
what can i put instead of NULL?
|
|
|
|
|
See here. The handle comes to you in the DllMain() function of your DLL. If you don't have access to DllMain() , you might also be able to use GetModuleHandle() to get the DLL's handle.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi all,
I am working on Outlook Addin using vc++. I am facing problem to the get_Subject or GetSubject method . Please give me the solution for this I have given the code snippet below....
Thanks In Advance..
CComQIPtr<Outlook::_Application>Application; <br />
CComPtr<Outlook::_Explorer>pExplorer; <br />
CComPtr<Outlook::Selection>pSelection; <br />
CComQIPtr<Outlook::_MailItem>pMailItem; <br />
char *str=new char[100]; <br />
IDispatch *pDispatchItem; <br />
CComVariant covIndex;<br />
BSTR subject; <br />
<br />
pExplorer =Application->ActiveExplorer(); <br />
pSelection=pExplorer->GetSelection();<br />
covIndex.vt = VT_I4 ;<br />
covIndex.lVal =1;<br />
pDispatchItem=pSelection->Item(covIndex); pMailItem=reinterpret_cast<_MailItem *>(pDispatchItem); <big>pExplorer->get_Subjet(&subject); <br />
str=_com_util::ConvertBSTRToString(subject);
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
Most probably the statement pExplorer =Application->ActiveExplorer(); has not succeeded .
Try
if(pExplorer)
pExplorer->get_Subjet(&subject); // exception at this statement
And if the if statement failes , then rewrite the allocation code as
while(pExplorer!=NULL)
{
pExplorer =Application->ActiveExplorer();
}
These problems arise mostly in plugin codes becasue , plugin try to use the default memory allocated for the application to which this plugin is intended (here outloook exe)
redindian
|
|
|
|
|
Thanks For the reply.
dharani wrote: f(pExplorer)
pExplorer->get_Subjet(&subject); // exception at this statement
I am Very Sorry. I wrote the wrong statement in my question, the statement I intended to write is as follows...
pMailItem->get_Subjet(&subject);
But....
pExplorer->GetCaption();
this statment is giving the proper output..
Means there is no problem with pExplorer.
Then what is the the problem with _MailItem even sometimes get_SenderName is giving the output.
Please give me the solution.
Thanks Again for ur Immidiate Reply and Helpful suggestion...
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
You will have to initialize the CComQIPtr Application pointer with the object from Outlook. What I can assume from your code is that you are not initializing this pointer with the outlook object. How does your application know that it has to get an instance for outlook, so this fails and then when you do something to get the subject it causes an exception to be thrown.
you can also try debugging your application.
Try something like this. I haven't checked the code but it might help you.
CComQIPtr<Outlook::_Application> spApp;
HRESULT hr = spApp.CoCreateInstance(__uuidof(Application));
if (FAILED(hr)){
MessageBox("Unable to instantiate Outlook.","Outlook Error",MB_OK);
return 0;
}
-- modified at 0:30 Friday 10th November, 2006
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hey friend,
I want to transfer query result from sql to a ComboBox.I derive a class from base class CComboBox.But,when using it in project,breaks when InitDialog at
...
myCombo->AddString(Sql.pData[i]);
...
anybody have solution?
Thank.
mad:
Lee
|
|
|
|
|
hello
What do you do to Sql.pData[i] before callinng AddString() ?
Did you check if there are values in Sql.pData ?
Put a break point there ?
Did you verify if you have called CMyComboxClass *myCombo = new CMyComboxClass() ?
redindian
|
|
|
|
|
How do you create combobox before use?
|
|
|
|
|
I want to register ATL COM DllServer in mFC Application, how can i do it.
I adds the sipport of ATL, and one NEw ATL COM object to my application, now i want to register this object in registry through My application, For example if we create ATL COM wizard application ,ther is a function DllRegisterServer() ....
Plz help me out
|
|
|
|
|
Hi
Use shellexecute(regsvr32,path of dll);
redindian
|
|
|
|
|
Hi look at this example
ShellExecute( NULL, _T("open"), _T("regsvr32"), _T("/s \"") + szFolder + _T("yourATLCOM.dll\""),NULL,SW_HIDE);
redindian
|
|
|
|
|
Thnaks for reply.
What is the fourth argument, szFolder what it is?
|
|
|
|
|
Its path of the folder where your dll is present .
redindian
|
|
|
|
|
how to get the path from which drive our ATL COM application is running,
if i used GetCommandString() it gives default path c:\Windows\explorer.exe
but what i want is, if i am running the application from D drive the path comes as d:\ like FOR MFC Application it works but for ATL COM applications doesn't work...
plz help me out
|
|
|
|
|
hi friend,
you already got an answer for your question, but i am having a suggestion. if you use shell functions , you need to add shell library and its platform dependent. So my idea is you to go for DllRegServer() function which is inside your COM object. Load this function, it will do your job. This method will give you the exact error report. If you use shell , you can’t. And one more thing , This method is not useful for all kind of COM dll’s suppose if you are building a Shell Extension dll, you need to use Shell API o register that dll.
thanks
|
|
|
|