|
Programm3r wrote: but, this might the problem right?
Yes this is the problem. Better do that this way:
HKEY hkResult;
And pass the address of the key to your function (&hkResult)
|
|
|
|
|
Try something like this (I haven't tested this):
-----
// Open the key.
HKEY hKey;
LONG res = RegOpenKeyEx(
HKEY_CURRENT_USER,
_T("Software\\My Company\\My Product"),
0,
KEY_READ,
&hKey
);
if (res==ERROR_SUCCESS)
{
// Now read a value in the key we opened.
DWORD Value; // Value to read.
DWORD Type;
res = RegQueryValueEx(
hKey,
_T("My value"),
NULL,
&Type,
reinterpret_cast<const BYTE*>(&Value),
sizeof(Value)
);
if (res==ERROR_SUCCESS)
{
if (Type==REG_DWORD)
{
// Access data in 'Value'.
}
}
// Close the key.
RegCloseKey(hKey);
}
Steve
|
|
|
|
|
i have a function Accept() to which i have passed a reference of SOCKADDR_IN.
SOCKADDR_IN clientName;<br />
Accept(*m_pSrcClientSocket,(SOCKADDR*)&clientName,&len);
now i want the requested system's ip address. when i am accessing it form clientName.sin_addr.s_addr - i am getting a long. How can i conver it ot ip address form. like (127.0.0.1).
Thank you.
KIRAN PINJARLA
|
|
|
|
|
gethostbyaddr
The gethostbyaddr function retrieves the host information corresponding to a network address.
gethostbyname
The gethostbyname function retrieves host information corresponding to a host name from a host database.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thank you.
If i have a CSocket object pointer *m_pClientSocket which is passed to Accept(), Can we know the ip address from that?
KIRAN PINJARLA
|
|
|
|
|
hi,
i am new to vc++,i am doing program on richedit(like chat window),i took two richedit controls and one button also, i am typing some text in first richeditcontrol afterthat i click on buttoncontrol or press enter then the text will display second richeditcontrol.
anyone please help me,
thanks.
kanth
|
|
|
|
|
muravi wrote: display second richeditcontrol.
Don't be in a hurry man.Be patient.
See my reply to your previous post...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
While i'm inserting the list control in a dialog, if i close the dialog, it crashes.. It aborts at setItemText of the list control.
How can i gracefully exit? There is a chance that the user can click the "OK" button in the dialog while the list control in the dialog is getting filled.
Any clues please?
Thanks
Raji
|
|
|
|
|
set a flag before starting filling operation and reset it after completion of operation.
You can check it in OnOk ,OnCancel and decide whether to exit or not.
Alternatively you can use synchronization classes.
|
|
|
|
|
Whats error?do you use from debugger?
|
|
|
|
|
hi,
i am new to vc++,i am doing program on richedit(like chat window),i took two richedit controls and one button also, i am typing some text in first richeditcontrol afterthat i clicked on buttoncontrol or press enter then the text will display second richeditcontrol,
thanks.
kanth
|
|
|
|
|
On the click of the button get the text from the first rich edit control and set it in the second one. That's all
Something like
m_richedit1.GetWindowText();
m_richedit2.SetWindowText();
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
sorry i didnt saw ur reply and once again thanks for ur help.
kanth
|
|
|
|
|
Hi to All,
I need to write some application that work as client server ( some flag in the init will define if its work as client or server).
The application need to send some file from Client to the server.
My question are:
1.I don't know how to create new thread in the server level...in my application each client that connect to the server need to be open as thread to give option other client to connect also - how i do this ??
2.How i send the file from client to the server ? i want to use serialization but how i connect CArchive object the the socket?
Thanks for any help.
P.S : if some one have some example of some application that do all what i need ...i will be happy to have the link ( i did not find in google some example )
|
|
|
|
|
|
connection of the client to the server.
|
|
|
|
|
|
Hi,
I've a mdi application with different views and one document template. Now I want to load a file automaticly (without clicking on the menue), thats works. But when I do this the new childframe will be displayed. I want to see the childframe from where I open the new file. So that the user can switch to the new childframe when he wants.
Is there any possibilities to open childframes and hide them after the activ one?
Thanks for help
yummi
|
|
|
|
|
Hi,
I've written a wrapper (filter) over the regular display driver for Win2k. I trap all the Drv* calls from the GDI and pass on the ones which i'm not interested in to the regular disp driver. Now i want to pass on some data from an app in the user space to my filter driver. Will it be possible to have this communication thru regular IOCTL stuff, or is there any other way ???
Many thnx in advance.
vikas.
|
|
|
|
|
Hello,
I'm working to define a toolbar. I would like to modify the handle.
I have drawn a picture, put it inside the toolbar as handle but I could manage the picture as a handle.
Does somebody know how to get the picture ID to after allocate it as handle ?
Thanks
titi
|
|
|
|
|
Can you be more specific about picture ID
|
|
|
|
|
I used a CStatic and then loaded a Bitmap into it.
titi
|
|
|
|
|
Hi Everybody,
In my application i have splitted the dialog window into three panes horizontally.By selecting the buttons in the first pane views wii change in second splitter pane.But while changing the views in the second pane the third splitter pane size is decreasing.The number of times the views are changed in the second splitter pane ,the size of the third splitter pane is decreasing that much number of times .So,what should i do to make the size of the third pane constant.
Thanks in advace,
Radhika.
|
|
|
|
|
Hi,
I am new to Visual Studio 2005. I couldn't find the handy Components and Controls Gallery, which was available in Visual Studio 6, through Projects -> Add to Project -> Components and Controls.
Is it gone? If so, how do I accomplish the tasks that I could with the Components and Controls Gallery, like adding an ActiveX control, a popup menu, or a splash screen?
Thank you all for your attention.
Eddie
|
|
|
|
|
I want to know How can i move the Modeless Dialogs , when i move the Parent dialog ?
//Member variables in Parent Dialog:
CMyModelessDlg m_modeLess; // The CDialog bases Modeless
BOOL CMyParentDlg::OnInitDialog()
{
CDialog::OnInitDialog();
//////////////////////////////////////////
m_modeLess.Create(CMyModeless::IDD);
m_modeLess.ShowWindow(SW_SHOW);
}
Can you please tell me how can i move the Modeless Dialog, when i move the Parent Window. ? actualyy I send a Mesage to Modelss Dialog from the Parent Dialog when WM_MOVING , every thing is goin allright , but the Modeless dialog comes on the position of parent dialog s XY postion , i want just want to Move the Modeless with Parent , but only the X,Y ! hope you understand
Thanks in Advance !
|
|
|
|