|
Hmm I'm not sure how you're getting 7.
I tried your code after a single CreateNamedPipe() call and got 1, as expected.
The instance count should remain equal to the number of CreateNamedPipe() calls you've made
for a given name until you've closed the handle to the pipe instance.
This may not be useful to you.
What do you need to wait for before exiting your process ? Are you waiting for all clients
to disconnect?
Mark
"Go that way, really fast. If something gets in your way, turn."
|
|
|
|
|
I need to wait for all the namedpipe instance to be disconnected by the server first before my process exit.
I tried again the code, I already getting "1" for the instance count.
If the server already called the DisconnectNamedPipe(), shouldn't be the number of instance decreased?
thanks again
-- modified at 10:09 Tuesday 26th June, 2007
|
|
|
|
|
how to disable collapsing a tree item? using CTreeCtrl, thanks!
|
|
|
|
|
Handle the TVN_ITEMEXPANDING notification and set *pResult = 1;
|
|
|
|
|
hi, thanks but i meant the user should not be able to COLLAPSE the item, i changed the double click and keydown event, it works!
|
|
|
|
|
void AceAuditMainDialog::OnTvnKeydownMainTree(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMTVKEYDOWN pTVKeyDown = reinterpret_cast<lpnmtvkeydown>(pNMHDR);
// TODO: Add your control notification handler code here
if ( pTVKeyDown->wVKey == VK_LEFT )
{
// ???
}
*pResult = 0;
}
what should i do inside the if? i want the program do nothing, not to collapse the tree item
|
|
|
|
|
I dont suggest you to handle the key down event to prevent the item from collapsing. As i previously said, overide the TVN_ITEMEXPANDING and handle the collapsing there
void MYDlg::OnItemexpandingTree1(NMHDR* pNMHDR, LRESULT* pResult) <br />
{<br />
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;<br />
if( items is already expanded)<br />
{<br />
*pResult = 1;<br />
}<br />
else<br />
{<br />
*pResult = 0;<br />
}<br />
}
|
|
|
|
|
nathan7 wrote: but i meant the user should not be able to COLLAPSE the item
Thats what I meant also. If you set that value as 1, that nodes will no longer able to collapse.
nathan7 wrote: i changed the double click and keydown event, it works!
What all keys you handled? Did u try pressing -( minus ) in the node?I doubt there are more keys like this. So you have to handle all that..
|
|
|
|
|
but if i do as u said, i can't expand the tree
|
|
|
|
|
I have posted the code here[^]. Did you notice that if condition? You can get whether an item is laready expanded or not using the GetItemState() function.
|
|
|
|
|
sorry i didn't see ur code carefully, thanks i understand now~~
|
|
|
|
|
use CTreeCtrl, how to set the font color of a single tree item? other item's font color is not changed
nathan
|
|
|
|
|
You have to handle the NM_CUSTOMDRAW, notification if you want to do this.
|
|
|
|
|
|
I am trying to consume a web service via a dll, I just want to pass in a variable length string that can be up to 5000 characters long, this string is is then passed directy to the web service. I have followed the example in the MSDN on creating a client that consumes a web service http://msdn2.microsoft.com/en-us/library/2k53kft2(VS.80).aspx which works fine but when I change the web service and calling methods to work with a string I get errors, any help on how I should do would be much appreciated.
also Im very new to C++
This is my DLL function that calls the web method.
extern "C" __declspec (dllexport) int __cdecl EMSWSTools(char *lpCmdLine) <br />
<br />
{<br />
using namespace std;<br />
int ret = 0;<br />
<br />
EMSSupTools::CEMSSupTools ws; <br />
<br />
<br />
HRESULT hr = ws.EMSHelper(lpCmdLine, &ret);<br />
if (SUCCEEDED(hr))<br />
return(ret);<br />
else<br />
return(0);<br />
}
|
|
|
|
|
rluckwell wrote: I get errors,
What types of errors are these ?
Add web reference for it again, deleting previous one.
Probably, proxy class and namespace added will be of difference name.
Prasad
MS MVP - VC++
|
|
|
|
|
The error is an AccessViolationException: - Attempted to read or write protected memory. this is often an indication the other memory is corrupt.
I have tried to re add the web reference. I have another web method the just returns an integer which works. I have also setup the test harness in VB that calls the web methods directly and this works fine to.
|
|
|
|
|
Does CFile::Read take a binary file?
|
|
|
|
|
|
Yes. CFile is designed toward binary file access.
It's basically a wrapper for the Windows CreateFile()/ReadFile()/WriteFile()/SetFilePointer()/
CloseHandle()/etc. APIs.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
CFile::Read("test.bin",CFile::modeRead) is the mode to read a binary file? or different flag? Thanks
|
|
|
|
|
From the docs: "One access permission and one share option are required"...
something like
CFile file(_T("pathname"), CFile::modeRead | CFile::shareDenyNone);
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi,
I have written a custom expression evaluator add-in (EEAddIn) that I use with the Visual Studio .NET 2003 debugger to improve the display of certain C++ objects. The EEAddIn interface is very limited, however, and I would really like to be able to call GetExpression on the process being debugged while handling an EEAddIn callback. Unfortunately, GetExpression does not seem to work in this case.
I can use a separate add-in (EEAddInHelper) that calls GetExpression during an OnEnterBreakMode event handler to retrieve certain information from the debugged process. However, at this point I don't know the type that the expression evaluator is trying to display. Therefore, I am limited to retrieving certain general, static, type information from the process (e.g. the size of certain types that I am interested in handling in my EEAddIn).
If I try to call GetExpression while inside an EEAddIn callback, GetExpression returns E_FAIL and answers a NULL string. This happens regardless of the value of the UseAutoExpandRules parameter. I am invoking GetExpression from my EEAddInHelper, and I get a handle to this add-in via a call to GetModuleHandle in my EEAddIn callback handler. I am able to call other functions in EEAddInHelper to retrieve the static type information (which EEAddInHelper previously got by calling GetExpression in its OnEnterBreakMode handler), but direct (synchronous) calls to GetExpression always fail. Note that most of the ideas for my EEAddIn and EEAddInHelper come from http://www.codeproject.com/macro/CRCView.asp.
Does anyone know why GetExpression fails and whether there is a work-around? Would it help if I called GetExpression in a separate thread that I spawn while handling the EEAddIn callback? Are there any recommendations for debugging this problem?
Any help would be greatly appreciated.
Thanks.
|
|
|
|
|
Im using C++, and OpenGL. For some reason when I run my game on a AMD machine it has these skips. When I run it on an Intel it runs fine. It could have nothing to do with the CPU but I suspect it may have something to do with it (maybe QueryPerformance?)
Thanks for any help or advice.
|
|
|
|
|
R.A.V.E. wrote: it has these skips
What is a 'skip' ? What do you mean by that ?
|
|
|
|