|
One solution is an OVERLAPPED I/O model or the IOCP.
Kuphryn
|
|
|
|
|
Hi !
My application is showing two different docking windows. I have a class for the main window and another class for the docking window. I want to call a method of another class from either the menu of the main window, or the context menu from the docking window.
How should I do that : The mainwindow and the dockwindow call a method of the application object, which will call the method of the target object, of the mainwindow and the dockwindow both know the target object and call directly the method of this object ?
Thanks for your suggestions !
Jerome
|
|
|
|
|
Your question is incomprehensible.
First explain the scenario, and then the problem you are facing. may be you can add a few code snippets as well.
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors"
|
|
|
|
|
Help !!
I want to rotate the display 90°, I wrote these few lines below but nothing happends running it under XP.
Anyone have any ideas ???
{
LPCTSTR lpszDeviceName = NULL; // name of display device
DEVMODE DevMode; // graphics mode
HWND hwnd = NULL; // not used; must be NULL
DWORD dwflags = 0; // graphics mode options
LPVOID lParam = NULL; // video parameters (or NULL)
DISPLAY_DEVICE DisplayDevice;
DisplayDevice.cb = sizeof(DISPLAY_DEVICE);
DWORD iDevNum = 0;
DWORD dwFlags = 0;
EnumDisplayDevices(NULL,iDevNum,&DisplayDevice, dwFlags);
DevMode.dmSize = sizeof(DEVMODE);
EnumDisplaySettings(DisplayDevice.DeviceName, ENUM_CURRENT_SETTINGS,
&DevMode);
dwFlags = 0;
DevMode.dmPelsHeight = 640;
DevMode.dmPelsWidth = 480;
DevMode.dmBitsPerPel = 16;
DevMode.dmDisplayOrientation = DMDO_90;
ChangeDisplaySettingsEx(DisplayDevice.DeviceName,&DevMode, hwnd, dwflags,
lParam);
}
|
|
|
|
|
Hi friends,
i am doing an mfc application i am having a tree ctrl.
Now the thing is i dont want the tree ctrl to collapse
how to do it any suggestion is welcome.
Thanx
TAKE CARE
|
|
|
|
|
Try this:
void CMyTreeCtrl::CollapseBranch(HTREEITEM hti)<br />
{<br />
if(ItemHasChildren(hti)){<br />
Expand(hti, TVE_COLLAPSE);<br />
hti = GetChildItem(hti);<br />
do <br />
CollapseBranch(hti);<br />
while((hti = GetNextSiblingItem(hti)) != NULL);<br />
}<br />
}<br />
<br />
void CMyTreeCtrl::CollapseAll()<br />
{<br />
HTREEITEM hti = GetRootItem();<br />
<br />
do{ <br />
CollapseBranch(hti);<br />
}while((hti = GetNextSiblingItem(hti)) != NULL);<br />
}
HTH,
K.
Every gun that is made, every warship launched, every rocket fired, signifies in the final sense a theft from those who hunger and are not fed, those who are cold and are not clothed - Dwight D. Eisenhower
|
|
|
|
|
hi friend,
Hey this code is not working in following senario..
what i have done is i have mapped TVN_ITEMEXPANDING of the Tree ctrl in my Dialog box Class.
then i have assigned a variable to the treectrl named m_treectrl
i have written the code u have provided in the Dialog box class
and have inserted the m_treectrl var before the CTreectrl Class function u have used in the collapse function for eg
GetRootItem(); has been replaed by
m_TreeCtrl.GetRootItem();
and in the TVN_ITEMEXPANDING I have called the collapseall function but it doesnt work. can u suggest any help ??
waiting for ur reply...
Thanx
TAKE CARE
|
|
|
|
|
sorry, I wasn't careful enough when reading, I understood you wanted to collapse your treectrl
To avoid it to collapse, do this:
<code>
void CTreeDialog::OnItemexpandingTreectrl(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
*pResult = (pNMTreeView->action == TVE_COLLAPSE);
}
Every gun that is made, every warship launched, every rocket fired, signifies in the final sense a theft from those who hunger and are not fed, those who are cold and are not clothed - Dwight D. Eisenhower
|
|
|
|
|
I have a set of applications for which I must create resources in Russian. They have been working for a number of years with various Western-European languages. Resources in the exe are English; resource-only dlls are used to support other languages. The user can switch between the available languages at run-time.
Now I have to do it in Russian. I assume that the obvious way to do this is to build a Unicode dll. However the apps have no Unicode support. Is this a problem? If so then what is the best solution/workaround? It's not feasible to convert the apps to Unicode (~350,000 lines of code, ~3 weeks).
Thanks in advance.
Phil
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
Unicode/ANSI only applies to code, really. I believe that all strings in resources are stored in Unicode. What matters is whether your code that reads the resources can handle the Russian character set properly (which, really, shouldn't be a problem since it's a single-byte character set).
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Ericahist updated Aug 30!
|
|
|
|
|
Hi all
I wish to found a help about using ICQ ActiveX controls.
Whether exist one and where i can get it.
Thanks.
|
|
|
|
|
|
hi,
i'm looking for the source code to determine whether a file is made of ASCII or UNICODE signs. Maybe somebody of you has one !
Thanks in advance!
|
|
|
|
|
you can use the API ::IsTextUnicode()
You pass it a sample of the contents of your text file and it uses a combination of statistical methods to determine if your sample is UNICODE encoded.
I Dream of Absolute Zero
|
|
|
|
|
|
Hello,
the problem is, that I need a identifier number of someones computer to transmit over the net. The number is used to identify a user who want to log on on a game server. It is important for the provider to have a possibility to kickban cheating users. I know that every networkcard has a specific hardware-number wich I can use for this purpose. But - how can I get that number in VC?
Thank you for your help,
Regards Andreas Niedermeier
|
|
|
|
|
Hello,
In order to get the MAC address for a particular Network Interface Card ( NIC in short) use GetAdaptersInfo
OK
The Phantom.
|
|
|
|
|
See the MSDN article Q118623.
|
|
|
|
|
sorry, stupid question: where can I find this article?
Thanks, Andreas Niedermeier
|
|
|
|
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netbios/netbios_1l82.asp
|
|
|
|
|
Thank You, - they are writing that it won´t work with Win98. Do you know something else wich will work on W98 too?
|
|
|
|
|
I think the operative word is reliably. You might want to try it in your environment to see how it behaves.
The GetAdaptersInfo() suggestion mentioned earlier will work. Here's a snippet:
IP_ADAPTER_INFO AdapterInfo[5];
PIP_ADAPTER_INFO pCurrentAdapter;
ULONG ulSize;
ulSize = sizeof(AdapterInfo);
if (GetAdaptersInfo(AdapterInfo, &ulSize) == ERROR_SUCCESS)
{
pCurrentAdapter = &AdapterInfo[0];
assert(NULL != pCurrentAdapter);
printf(" MAC Address = ");
for (UINT x = 0; x < pCurrentAdapter->AddressLength; x++)
printf("%02x ", pCurrentAdapter->Address[x]);
}
|
|
|
|
|
Thank you very much for that, hope I can help you one time..
Best regards from Munich/Germany, Andreas Niedermeier
|
|
|
|
|
I would like to know if on the rare occasion my app crashes, that instead of invoking drwatson32 on XP, and giving the lovely dialog to e-mail Microsoft, that it launches my own instead, so that it is easy for a customer to copy the log file to his own PC, and mail it to me from another PC. I then want to add additional info in my own app.
My wish-list is a couple of reg keys or APIs, and also to be able to use this on NT4 and Win 2000. I have seen some apps that got to town, but I just want the neat basics, not a full-blown heapwalk/process demo!
Conrad - conradb@adroit.co.za
Always do badly to start off, that way when you get the hang of it suddenly, everyone is surprised.
|
|
|
|
|