|
Hello fellow developers,
I'm using the serial communication library described in the article:
Serial library for C++
The problem is that I have a customer where the serial port COM1 reports to be in use (ERROR_ACCESS_DENIED) when I try to open the port (CreateFile) after a computer restart. I have tried to find out which program that use the port by searching for \Device\Serial in Process Explorer and Handle by Sysinternals. But with no success. The handle seems to be in use but no process wants to admit it. The customer has to restart the system several times before the serial port can be accessed again. So I am wondering if there are additional methods to find who use a specific COM port or if anyone can shed more light on this problem of mine.
The COM port used is the one placed on the motherboard of a Intel D945GNT motherboard. The system has 2 addtional COM ports on a PCI-express card, these are used without any problem. The system has had a LAN to COM port driver, Lantronix, installed earlier. The system is running Windows XP SP2.
Best regards,
Erik
|
|
|
|
|
It may be that no userland processes are using COM1. Perhaps a hardware device such as touchscreen driver or Ethernet to COM have exclusive access to the port.
-David Delaune
|
|
|
|
|
I am adding new fields to the summary information for a file in this application I am working and I want to know if I can create a property identifier for the UserDefinedProperties? For example, already existing is
// Summary Information
PID_TITLE = 2;
//DocumentSummaryInformation
I was thinking I should add a field similar to PIDDSI_CATEGORY for UserDefined, which has a property identifier value of 0x00000002, but I do not know how?
|
|
|
|
|
You should review this[^] MSDN article, where it states :
The UserDefined property set can be used to hold any properties. Typically, it is used to store named properties created by a user.
|
|
|
|
|
Hi All,
I'm using Visual Studio 2003, and MFC/C++.
I want to simulate just the update/refresh portion of the maximize command, on an ie window. I've already managed to connect to the window and can send minimize and maximize commands to it, as well as move the window around the screen, even hide and show the window if I wish to. I just need to know what message or function I have to pass to that window to get it to do JUST the refresh portion of its maximize command.
Here's some background info and stuff I've already tried:
I have an internet page, that uses java applets served from a server I have no control over. The internet page loads, but none of the background graphics, or button graphics load, so you pretty much have to click on a blank screen and "guess" where the buttons are.
However, if you minimize the window, and maximize (tested over 100 times, by multiple people, under different conditions, with a 100% success ratio), it'll redraw the window properly.
I've tried simulating a very rapid alt+tab and it restored the buttons graphics but not the main graphic (not acceptable to my client). I've also tried the following commands:
::RedrawWindow(hWnd,0,0,RDW_INVALIDATE);
::RedrawWindow(hWnd,0,0,0);
::UpdateWindow(hWnd);
::SetFocus(hWnd);
Any help here would be greatly appreciated.
Thanks,
Brian
|
|
|
|
|
|
Hi
I used RichEdit ctrl with "RICHEDIT20W" for unicode support.
When FindText or FindTextW is called, its getting Failed.
Please could you tell the procedure for utilizing the FindText method
Regards,
nag.
|
|
|
|
|
nagamohan_p wrote: When FindText or FindTextW is called, its getting Failed.
So what does GetLastError() return?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Which either indicates that FindTextW() is not failing, or some other function is being called after FindTextW() but before GetLastError() .
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
FindTextW() returns -1...
AFter calling FindTextW(), immediately GetLastError() is called.
Initially I placed richedit ctrl in dialog...after that RICHEDIT is replaced with RICHEDIT20W in .rc file...
I have to diplay the text with different colors. When RICHEDIT20W is replaced with RICHEDIT, FindText() is not getting failed...
|
|
|
|
|
nagamohan_p wrote: FindTextW() returns -1...
AFter calling FindTextW(), immediately GetLastError() is called.
So you have something like:
long lResult = m_richedit.FindTextW(...);
if (lResult == -1)
DWORD dwError = GetLastError();
What happens if you use FindText() with RICHEDIT ?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Here is code: <br />
m_listCtrl.SetListView(LVS_LIST);<br />
LV_COLUMN lsCol;<br />
LV_ITEM lsIte;<br />
lsCol.mask = LVCF_FMT|LVCF_WIDTH|LVC_TEXT|LVC_SUBITEM;<br />
lsCol.fmt = LVCFMT_LEFT;<br />
lsCol.cx = 20;<br />
<br />
char* arColumns[7] = {"Date","I","II","III","IV","V","VI"};<br />
<br />
for(int i=0; i<7; i++)<br />
{<br />
lcCol.iSubItem = i;<br />
lsCol.pszText = arColumns[i];<br />
m_listCtrl.InsertColumn(i, &lsCol);<br />
}
error C2065: 'LVCTEXT' : undeclared identifier
'LVC_SUBITEM' : undeclared identifier
lcCol' : undeclared identifier
left of '.iSubItem' must have class/struct/union type
Generating Code...
Error executing cl.exe.
WHAT IS WRONG?
Given this bug. I need to the a header file or what?
What is this?
|
|
|
|
|
Hakan Bulut wrote: lsCol.mask = LVCF_FMT|LVCF_WIDTH|LVC_TEXT|LVC_SUBITEM;
Should be:
lsCol.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
it must be overlooked... Thank you very much.
Volkan Cin
What is this?
|
|
|
|
|
I go to control panel and change the regional language & settings as germany
And i start my application it gets hanged.
Will there be any possiblity that language will cause this problem..
|
|
|
|
|
Of course.
It depends what you do... you need to debug it yourself
Greetings from Germany
|
|
|
|
|
|
Hi experts
I want to detect shutdown of the system through my application mine application is a property sheet.
Thanks in advance
RYK
|
|
|
|
|
VC_RYK wrote: I want to detect shutdown of the system through my application mine application is a property sheet.
Handle WM_QUERYENDSESSION .
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
|
|
|
|
|
WM_ENDSESSION
prasann
who else
|
|
|
|
|
But i want any API suppose i ahve to use somewhere in console base aaplication.
|
|
|
|
|
VC_RYK wrote: suppose i ahve to use somewhere in console base aaplication.
In that case, you could use the SetConsoleCtrlHandler() API.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I've written a control that hosts the web browser which works great when viewing a web page (HTML) but has a problem when viewing an XPS document. When the operator tabs to my host window I send a WM_SETFOCUS message which is processed by the following function:
VOID OnSetFocus(HWND hwnd)
{
IOleObject *pOleObject=getOleObject();
if (pOleObject)
{
RECT rc;
GetClientRect(hwnd,&rc);
pOleObject->DoVerb(OLEIVERB_UIACTIVATE,NULL,pSites,0,hwnd,&rc);
IWebBrowser2 *pWebBrowser=NULL;
if (pOleObject->QueryInterface(IID_IWebBrowser2,(void **)&pWebBrowser)==S_OK)
{
IOleInPlaceActiveObject *pOleInPlaceActiveObj=NULL;
if (pWebBrowser->QueryInterface(IID_IOleInPlaceActiveObject,(void **)&pOleInPlaceActiveObj)==S_OK)
{
MSG msg={0};
msg.hwnd=hwnd;
msg.lParam=1;
msg.wParam=VK_TAB;
msg.message=WM_KEYDOWN;
pOleInPlaceActiveObj->TranslateAccelerator(&msg);
pOleInPlaceActiveObj->Release();
}
pWebBrowser->Release();
}
}
}
The above works fine for web pages as focus always seems to be changed to the first window below 'Shell DocObject View' which for web pages is 'Internet Explorer_Server'. When using the XPS view plug-in there are two levels below which are 'DocObject_Top_Class' and 'HwndWrapper'.
The window layouts when viewing a web page looks like this:
MyHostWindow
ShellEmbedding
Shell DocObject View
Internet Explorer_Server --> This window gets the focus which means the tab key continues to function
The window layout when viewing an XPS document looks like this:
MyHostWindow
ShellEmbedding
Shell DocObject View
DocObject_Top_Class --> This window gets the focus which means the tab key stops working
HwndWrapper[WCP_Hosted... --> Focus should be here so the tab key continues to function
Does anyone know how to sort out the focus problem?
|
|
|
|
|
There is no source code available for the current location!
When my VS2005 run the vc++ project, it will appear above message.
But my VS2005 did not have this problem yeaterday.
How do I solve this problem?
|
|
|
|