|
sankarRao wrote: How we can get the handle of child window
See the following API in case of Dialog's Child window
HWND GetDlgItem( HWND hDlg, int nIDDlgItem);
what do you mean send me as early as possible ?? is this you description of your question.. please ...we are not here for providing full solutions but suggestions....we are also developers like you.
Knock out 't' from can't,
You can if you think you can
-- modified at 5:44 Monday 19th June, 2006
|
|
|
|
|
A_Laxman...we are also developers like you.
Speak for yourself.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
I am unable to find any sample code covering the change of color in text output. I would be grasteful for any pointers.
Raymond Mercier
|
|
|
|
|
I'm not sure if this is what you are asking but theForger has a nice win32 API tutorial. It can be found here:
http://www.winprog.org/tutorial/dlgfaq.html
|
|
|
|
|
RaymondM wrote: I am unable to find any sample code covering the change of color in text output. I would be grasteful for any pointers.
See the Following link.
Here[^]
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Try this out (If possible use reflect message in yours )
HBRUSH CMessaJunkDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) <br />
{<br />
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);<br />
if (nCtlColor==CTLCOLOR_EDIT )<br />
pDC->SetTextColor (RGB(255,0,0));<br />
return hbr;<br />
}
Regards,
FarPointer
Blog:http://farpointer.blogspot.com/
|
|
|
|
|
Thanks to the three people who replied so promptly. Of course SetTextColor and the messages like WM_CTLCOLORDLG are the obvious thing, but somehow I had never had to do it before.
Raymond Mercier
|
|
|
|
|
in OnPaint function test this code
<br />
CPaintDC dc(this);
dc.SetTextColor(RGB(0,0,200));<br />
dc.TextOutW(10,10,_T("test"),4);<br />
whitesky
|
|
|
|
|
Experts!
I have a device conected to my computer with a USB,
i want to stop this device and then start it again.
i selected disable in the device manager and the device was disable successfully.
But when i tried to do it programmaticatly it failed.
I tried calling "net stop service_name_blabla" from the command line.
and i tried using SERVICE_CONTROL_STOP,in ControlService
but they both failed, reason:
"The requested control is not valid for this service. " error
how can i disable the service with C++ like i'm doing well in the device manager ?
thanks.
|
|
|
|
|
BabyGuru wrote: a device conected to my computer with a USB
BabyGuru wrote: how can i disable the service with C++ like i'm doing well in the device manager ?
Use SetupDiSetClassInstallParams function to do this.
Maxwell Chen
|
|
|
|
|
Is it possible to use iTunes SDK without installing itunes? Can I use APIs provided by iTunes SDK just by registering the required DLLs and with required files? Please send me some links where I can find sample applications to update iPod(sync) thru our own application which uses iTunes SDK.
Vignesh T R
|
|
|
|
|
Halid Niyaz wrote: Is it possible to use iTunes SDK without installing itunes? Can I use APIs provided by iTunes SDK just by registering the required DLLs and with required files? Please send me some links where I can find sample applications to update iPod(sync) thru our own application which uses iTunes SDK.
See the Following link where you get example.
Here[^]
If the Dll uses the Libraries then you have to link that library else it throws linker error.
Knock out 't' from can't,
You can if you think you can
-- modified at 5:01 Monday 19th June, 2006
|
|
|
|
|
how to use connect command in mfc . what are the paramaeters which is to be passed to connect to host.
prashant jain
-- modified at 4:53 Monday 19th June, 2006
|
|
|
|
|
From the docs :
int connect (
SOCKET s,
const struct sockaddr FAR* name,
int namelen
);
s
[in] A descriptor identifying an unconnected socket.
name
[in] The name of the socket to connect to.
namelen
[in] The length of the name parameter.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Here have a look at this!
http://msdn2.microsoft.com/en-us/dxt965kz.aspx
Robbie
|
|
|
|
|
Hi guys,
I have a function where I am passing a value by reference. Below is the prototype:
bool retrieveLogFileLocation(LPSTR&);
Now within the body of the function definition I have the following function as well.
bool retrieveLogFileLocation(LPSTR& value){
char[255] lszValue;
HKEY hKey;
LONG returnStatus;
DWORD dwType = REG_SZ;
DWORD dwSize =255;
bool success = true;
RegQueryValueEx(hKey, "InstallationPath", NULL, &dwType, (LPBYTE)&lszValue, &dwSize);
strcpy(value, lszValue);
}
The problem I am receiving is that whenever my program runs, it crashes instantly, and I know for sure it is an issue with strcpy(value, lszValue) . I have tried in multiple ways through type-casting and such to resolve the issue, but I'm perplexed as to whats causing the problem.
Any help would be appreciated
Robbie
-- modified at 4:53 Monday 19th June, 2006
PS: I only included bits and pieces of the function definition simply because the actual function definition is very long. :P
|
|
|
|
|
capricious_001 wrote: Any help would be appreciated
May be the length of the receiving string variable is short as compared to the data you tring to copy into it.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
hmm I didnt initialize the length of the referenced value variable to a certain length.
Actually I dont quite understand what you mean lol.
Robbie
|
|
|
|
|
An alternative way of doing this is to use a string class, e.g., CString. Here's some old code I dug out - look at the last if block - RegQueryValueEx call...
long OcipsAutoInterface::GetConsoleIDEx(LPCTSTR pszValueName, CString& strValueData)
{
HKEY hkOperatorConsole;
long nResult;
unsigned long nSize;
CString strSubKey;
strSubKey.LoadString( IDS_OP_CONSOLE_SUBKEY );
nResult = ::RegOpenKeyEx( HKEY_LOCAL_MACHINE,
LPCTSTR( strSubKey ),
0,
KEY_EXECUTE,
&hkOperatorConsole );
if ( ERROR_SUCCESS == nResult )
{
nResult = ::RegQueryValueEx( hkOperatorConsole, pszValueName, NULL, NULL, NULL, &nSize );
if ( ERROR_SUCCESS == nResult )
{
LPTSTR pszValueData = strValueData.GetBuffer( nSize );
nResult = ::RegQueryValueEx ( hkOperatorConsole, pszValueName, NULL, NULL, LPBYTE( pszValueData ), &nSize );
strValueData = pszValueData;
}
}
VERIFY( ERROR_SUCCESS == ::RegCloseKey( hkOperatorConsole ) );
return nResult;
}
Kevin
|
|
|
|
|
There isnt any other way? Because there is a lot of code I have to change if I change the type of that one variable. I'd prefer keeping value as a LPSTR type.
|
|
|
|
|
Well, in that case, as Laxman says, you need to carefully check the sizes of your source and destination buffers.
For future code though I recommend using string objects (string or CString) instead of C-style strings. You'll have fewer problems of this sort.
Kevin
|
|
|
|
|
Is there really a need to pass by reference cos i think it can work without it.
|
|
|
|
|
It's a problem with RegQueryValue(IMHO). You are not opening the registry before modifying it.
Handle to an open key. The key must have been opened with the KEY_QUERY_VALUE access right.
This handle is returned by the RegCreateKeyEx or RegOpenKeyEx function, or it can be one of the following predefined keys:
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_PERFORMANCE_DATA
HKEY_PERFORMANCE_NLSTEXT
HKEY_PERFORMANCE_TEXT
HKEY_USERS
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Ya I created a handle to the open key and all of that is fine (closed the handle appropriately etc). Its just with the strcpy that I'm having the problems with.
As well, either by passing via reference or returning LPSTR value, I am still receiving the same unhandled exception error. It still crashes when my program is loaded.
|
|
|
|