|
Christian Graus wrote:
Have you seen the guys photo on that artice ? Would you trust someone who looks like that to write code for - oh, sorry, Nish .....
Yeah, you'd have thought he was a model or a film actor going by his good looks eh?
Nish
Make MSDN universal, FREE!
|
|
|
|
|
Yeah - that's what I meant. Always hard to take those good looking people seriously.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Thank u very much!!!!! Ur work is really GREAT!!!! It's not a 5 it's a BIG 1000!!!
Dirso
|
|
|
|
|
Edilson Vasconcelos de Melo Junior wrote:
Thank u very much!!!!! Ur work is really GREAT!!!! It's not a 5 it's a BIG 1000!!!
Glad to be of assistance
Nish
Make MSDN universal, FREE!
|
|
|
|
|
This is pissing me off big time. I have an edit box in a dialog and want to show a balloon tip as soon as the dialog is open:
BOOL Welcome_OnInitDialog(HWND hDlg, HWND hWndFocus, LPARAM lParam)
{
SetDlgItemText(hDlg, IDC_MUSIC_FOLDER, g_musicFolder);
WCHAR szTitle[] = L"Music Folder";
WCHAR szText[] = L"Enter the path to your music folder here, or click browse..";
EDITBALLOONTIP ebt;
ebt.cbStruct = sizeof(ebt);
ebt.pszTitle = szTitle;
ebt.pszText = szText;
ebt.ttiIcon = TTI_INFO;
Edit_ShowBalloonTip(GetDlgItem(hDlg, IDC_MUSIC_FOLDER), &ebt);
return TRUE;
}
It is not working. Yet, when the user clicks the OK button. My WM_COMMAND hander has no problem displaying balloon tip:
void Welcome_OnCommand(HWND hDlg, int nId, HWND hWndCtrl, UINT uCodeNotify)
{
HWND hMusicFolder = GetDlgItem(hDlg, IDC_MUSIC_FOLDER);
if (nId == IDOK)
{
g_musicFolder.GetFromHWnd(hMusicFolder);
DWORD dwFileAttributes = GetFileAttributes(g_musicFolder);
if (dwFileAttributes == 0xffffffff || dwFileAttributes &
FILE_ATTRIBUTE_DIRECTORY != FILE_ATTRIBUTE_DIRECTORY)
{
SendMessage(hMusicFolder, EM_SETSEL, 0, -1);
WCHAR szTitle[] = L"Invalid folder name";
WCHAR szText[] = L"Please confirm that this is the path to your music folder.";
EDITBALLOONTIP ebt;
ebt.cbStruct = sizeof(ebt);
ebt.pszTitle = szTitle;
ebt.pszText = szText;
ebt.ttiIcon = TTI_WARNING;
Edit_ShowBalloonTip(hMusicFolder, &ebt);
return;
}
.
.
.
}
What's going on? Any fixes?
Thanks
|
|
|
|
|
The dialog may not have finished initializing until OnInitDialog() . Try setting up the balloon tip within a handler for a fake command (I use IDC_INIT_GUI ). Post the command (using PostMessage (WM_COMMAND, IDC_INIT_GUI) ) from within OnInitDialog() to ensure that the handler will be executed after the dialog has initialized itself.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
|
Mood swing problems?
I'm not late, I'm just not as early as I could have been.
|
|
|
|
|
Jonny Newman wrote:
Mood swing problems?
Nope, I think he's easter-drunk!
Nish
Has anyone seen my sig?
|
|
|
|
|
Nish [BusterBoy] wrote:
Nope, I think he's easter-drunk!
Yep, too many chocolate eggs have the same effect on me
Michael
|
|
|
|
|
CRect rect( 10, 10, 100, 100 );
CPoint ptBegin(20,50), ptEnd(200,200);
How to get the cut point of the rect and the line???
I'm amumu, and you?
|
|
|
|
|
You'll have to manually figure out the various points and use CRect::PtInRect on each of them
Nish
Has anyone seen my sig?
|
|
|
|
|
I don't think it is a good solution
I'm amumu, and you?
|
|
|
|
|
qf0421 wrote:
don't think it is a good solution
Well, seems to me, that, that's the only solution, unless someone has wrapped it into a class or function
Nish
Make MSDN universal, FREE!
|
|
|
|
|
Take a look at the LineDDA() function.
---
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.
|
|
|
|
|
Where can get it?
I'm amumu, and you?
|
|
|
|
|
qf0421 wrote:
Where can get it?
I've got one lying around here somewhere.....
It's part of GDI and has been since Windows 3.1. Don't you have MSDN ? Or the Internet ? msdn.microsoft.com is your friend.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
I can't find it in MSDN 2002.
I'm amumu, and you?
|
|
|
|
|
I see I need to start from the beginning. When the text is a different colour, chances are it's a hyperlink. To tell for sure, move your mouse over it and look in your status bar for a URL. Then click on the URL I provided for you in my last post, and you'll see the appropriate article online. It is most certainly also in the latest MSDN, and every MSDN since 1995, assuming they had them back then.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
"I'm somewhat suspicious of STL though. My (test,experimental) program worked first time. Whats that all about??!?!
- Jon Hulatt, 22/3/2002
|
|
|
|
|
Thank you, I got it
I'm amumu, and you?
|
|
|
|
|
The General Equation is:
// line one
A = pt2.y - pt1.y;
B = pt1.x - pt2.x;
C = pt1.x*A + B*pt1.y;
// line two
D = pt4.y - pt3.y;
E = pt3.x - pt4.x;
F = pt3.x*D + E*pt3.y;
DET = A*E - B*D;
if(fabs(DET) < DTSQ) // Paralell lines skip
{
// Paralell
}
else
{
// intersecting point
x = (E*C-B*F)/DET;
y = (A*F-D*C)/DET;
}
// DTSQ is deterimined by the accuracy you have (i.e. what is considered to be zero.)
example DTSQ=0.00001f
//Now is this point on the segement or not for each side of the rect you have. It may miss be on two sides or a corner.
Good ideas are not adopted automatically.
They must be driven into practice with courageous patients. -Admiral Rickover. ...
|
|
|
|
|
Thanks Michael, this is an excellent little piece of code. I knew there had to be an easy way of doing this and you nailed it I am going to add this code to my file of assorted functions.
Someone, with more knowledge in this area than me, should write an article containing a bunch of geometric functions like this one (or does one already exist somewhere?)
---
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.
|
|
|
|
|
First you are welcome
I thought Chris was going to write something, but I am not sure where it would be. I have a number of functions coded through the years. Mostly to support Finite Element Editors. That is part of the issue on what area to write for. I am sure if you did a search on google for the right set of terms you will find sources.
Good ideas are not adopted automatically.
They must be driven into practice with courageous patients. -Admiral Rickover. ...
|
|
|
|
|
I recently installed Visual Studio .NET and at times I feel a bit lost in the new development enviroment. For some reason I can't figure out I can't load a bitmap from a resource file. Obviously I'm not doing everything that I should. I'm doing a Win32 application, and not using MFC.
HBITMAP hBitmap; // global
// inside the message pump (WM_CREATE)
hBitmap = LoadBitmap(hThisInstance, "MyBitmap");
When I run the app I get the error code saying ERROR_RESOURCE_NAME_NOT_FOUND (the specified resource name cannot be found in the image file).
In the project I add a new bitmap resource, change the filename resulting in that Visual Studio load the bitmap into the Bitmap Editor. Visual Studio also gives the bitmap resource an ID, and I change this ID into a string called "MyBitmap". Using the Visual Studio resource identifier, after converting the ID using MAKEINTRESOURCE, results in the same error. Everything worked fine when using VC++ 6, so I'm getting a bit frustrated here. Help me please! Thanks a million!
|
|
|
|
|
can anyone tell me plz how to make a listbox appear on a CEditView plz. It's very important to me to make a ListBox appear at runtime.
Thanks in advance
Bernard Racoute
Mail @ bracoute@hotmail.com & Bracoute@hotpop.com
Bracoute
|
|
|
|