|
My artical on this subject shows how it can be done:
http://www.codeproject.com/docview/docviewfromdll.asp
Roger Allen
Sonork 100.10016
yet to be identified being from the planet Paltinmoriumbanfrettybooter
|
|
|
|
|
Just read the article - nicely done, Roger. No idea why you got a 4 out of 5 when the article does exactly what the title says and explains every step
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
Actually I show how to do this in my Visual C++.NET Bible. If you're still having problems, email me and I'll send you a demo and that part of the chapter.
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
I am using the code below to display my
dialog boxx..
The problem is that whenever it is displayed.. it
is cropped .. and this continues..
CRect myRect;
GetClientRect(&myRect);
ClientToScreen(myRect);
MoveWindow(myRect.left, myRect.top,
myRect.Width(), myRect.Height());
ShowWindow(SW_SHOWNORMAL);
Please Help
|
|
|
|
|
ummmmm
am i missing something or is this a really twisted way of showing a dialog box? is there a running thread of these posts that gets you to here so it makes sense?
situations to avoid #37: "good morning ... how many sugars do you take in your coffee ... and what was your name again?"
coming soon: situations to avoid #38: "...and the dog was there too?"
|
|
|
|
|
I'm with Lauren. I'm not sure what you're attempting to do here since you're not providing much in the way of details. Is this code from an init function (such as OnInitDialog) of the dialog or is this from another class trying to show the dialog?
If it's the former, your dialog is always going to be cropped because you're specifying the client area's height and width for the dialog size. If you just want to move the dialog - and not resize it use the SetWindowPos function and specify the SWP_NOSIZE flag:
SetWindowPos(NULL, 50, 50, 0, 0, SWP_NOSIZE);
Cheers,
Tom Archer
Author, Inside C#
Please note that the opinions expressed in this correspondence do not necessarily reflect the views of the author.
|
|
|
|
|
Hi,
I want that whenever my application starts, the Dialog
(in a dialog based application).. is hidden ShowWindow(SW_HIDE). (Actually this doesn't work under InitDialog()..
How do i do it
Sameer
|
|
|
|
|
This is answered in Mike Dunn's C++ FAQ.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Thanx a lot
|
|
|
|
|
string val = "32742937.234234";
how to change this type of string to double? Thanks!
|
|
|
|
|
Check your documentation on sscanf .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
strtod()
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
It may be that your sole purpose in life is simply to serve as a warning to others.
|
|
|
|
|
double ConvertStringToDouble(const CString s)
{
char pszString[MAX_PATH];
char* pszStop;
memset(pszString, '\0', MAX_PATH);
strncpy(pszString, (LPCTSTR)s, s.GetLength());
double d = strtod((const char*)pszString, &pszStop, 0);
return d;
}
|
|
|
|
|
double ConvertStringToDouble (LPCTSTR psz)
{
LPTSTR pszStop;
errno = 0;
return _tcstod (psz, &pszStop);
}
or (if you don't like the "T" variables)
double ConvertStringToDouble (const char *psz)
{
char *pszStop;
errno = 0;
return strtod (psz, &pszStop);
}
Since CString has a type cast to LPCTSTR and since you won't be storing the value into another CString, then there isn't any need to use CString in the argument list.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
Hi,
Suppose while running, my explorer restarts
itself (normally does in Win95 & win98).. how
do i detect that and make my icon in the system
tray REAPPEAR..
Please help
|
|
|
|
|
Assuming you've put the icon in the first place with Shell_NotifyIcon , you can have your app periodically (say with a timer) test whether the icon is still there by calling Shell_NotifyIcon with flag NIM_MODIFY and appropriate hWnd and uID parameters (it's not necessary you actually modify anything). If Shell_NotifyIcon fails, you can assume the icon is no longer present and proceed to insert it again.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
When explorer restarts it broadcasts a registered message "TaskbarCreated". You can process this message to redisplay your icon.
Regards
Phil
|
|
|
|
|
Hi,
Phil
Can u please elaborate on that.. what kind of message
is sent etc..
Sameer
|
|
|
|
|
The message is only sent if the system in question has IE4 or later.
As I said, it's a registered message. You get its message number like this...
const UINT wm_TaskbarCreated = RegisterWindowMessage(_T("TaskbarCreated"));
Then, in the WindowProc of the top-level frame window of your app. do something like this...
if (nMsg == wm_TaskbarCreated)
m_pTrayIcon->ReloadTheIcon();
A better way would be for your tray icon class to hook the WindowProc and be responsible for reloading itself. That avoids having to inject a chunk of code into an entirely unrelated class. Unfortunately I don't have time to explain all about that...
Hope this helps,
Phil
|
|
|
|
|
Here is the article for people who have the same problem in
future
Regards
Sameer
|
|
|
|
|
Hi All,
How to resolve ip address to hostname in WIN32? for example, given ip address 204.127.222.1, find the hostname (say, MYDOG ).
Thanks.
|
|
|
|
|
Use Winsock function gethostbyaddr . If you're not used to this library, remember you have to initialzie it before attempting to use it (have a look at WSAStartup .)
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
what are breakpoint and how are they use in vc++ 6.0.
karanba
|
|
|
|
|
Breakpoints are only used when debugging (F5 instead of Ctrl-F5). Place a breakpoint on the line where you want the execution to stop break (right-click->Add breakpoint), press F5, and when the breakpoint is reached use F5 (resume), F10 (step over), F11 (step into) and so on. All command can be found in the debug window.
/moliate
|
|
|
|
|
As title.
I'm amumu, and you?
|
|
|
|