|
Wow! I always implemented my own _splitpath routine. I had no idea that there was a function that does that. Thank you (even though this is not my post).
// Afterall, I realized that even my comment lines have bugs
When one cannot invent, one must at least improve (in bed).-My latest fortune cookie
|
|
|
|
|
Thanx! That really helped.
Martin_j
|
|
|
|
|
Or try the following to avoid _splitpath:
TCHAR tcFileName[ _MAX_PATH ] = {0};
::GetModuleFileName( GetModuleHandle(NULL), tcFileName, sizeof(tcFileName) / sizeof( tcFileName[ 0 ] ) );
LPTSTR lpszFileName = ::PathFindFileName( tcFileName );
if ( ( NULL != lpszFileName )
&& ( tcFileName != lpszFileName )
{
*lpszFileName = 0;
}
tcFileName now contains the directory.
Jens
|
|
|
|
|
In my project, i use a party HTML GUI. I included the pages as resources in the exe. I then let the HTML window navigate to res://NameOfApp.exe/305 . This works correctly. However, if i want to include an image (gif image sequence in my case), i can't get it done this way because there's no way to tell IE that the file i feed it is a GIF file , because it doesn't have an extension and there's no way i can use an extension for the file because it's a resource.
Is there a way in HTML to tell the browser that the file is in fact a GIF file?
|
|
|
|
|
Give it a string name instead of a numeric ID. That way you can navigate to res://NameOfApp.exe/MYFILE.GIF
--Mike--
"Big handwavy generalizations made from a position of deep ignorance is one of the biggest wastes of time on the net today.
-- Joel Spolsky
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
Still can't get this right....the res:// thingy only works for HTML pages and not for any image type . What am I doing wrong? Showing you the code isn't really usefull because there isn't much to show...
|
|
|
|
|
I inserted a JPG HTML resource in a DLL, and I can show that picture in IE with this URL:
res://C:\utils\dirclean.dll/ALY.JPG
I found the right combo of slashes and backslashes thru trial-and-error
--Mike--
"Big handwavy generalizations made from a position of deep ignorance is one of the biggest wastes of time on the net today.
-- Joel Spolsky
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
I used the exact same combo already but it just doesnt't work. Maybe it's the point that I use an exe instead of a DLL. You think that's what's wrong? If that's what i need to do (Use a DLL) then could you maybe give me a link to a project that uses resource DLL's in different languages (Like MSN messenger)?
Thanks for your awnser 
|
|
|
|
|
Hello,
I have a dialog-based application which supports resizing of its windows.
The resizing works very well, it's just a visual thing I am looking for: the resizing "image" on the right bottom.
For example open Internet Explorer and have a look bottom right. There are diagonal 3D lines, overlapping the status bar, which show that the dialog is resizable.
Do you know how to show these diagonal 3D lines?
Thanks
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
In your WM_PAINT handler, do this:
DrawFrameControl(hdc,rect,DFC_SCROLL,DFCS_SCROLLSIZEGRIP);
rect should be the rectangle where you want the frame control to be, and hdc should be the HDC of your window.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Hmm, I somehow can't get it working... Do you have a sample source snippet?
Thanks
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
The frame control is drawn now (the background isn't erased correctly, so if you have a source snippet send it to me, I am not that GUI expert ), but the background of the frame control is always the standard gray. The problem is now that my application uses a custom background color...
I tried to change the background color for the frame control using dc.SetBkColor and/or dc.SetBkMode(TRANSPARENT), but nothing worked, the gray background is drawn independently of what I set as DC background...
How can I make the frame control background drawn as the same as my main dialog background color?
PS: Going to now, so thanks in advance
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
You can't. But, I have a hint for if you want to draw your own gripper - the gripper glyphs are found in the Marlett font.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Hmm, I found the font and the symbols, but when I draw them they are only black lines instead of the 3D look. It seems I have to combine symbol 'o' (=white) and symbol 'p' (=dark gray) to make the 3D look
I've done it another way now: I've created an icon that looks like the 3D gripper Much easier
Anyway, thanks for your help
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
When I create a status bar those lines are there by default 
|
|
|
|
|
My dialog-based app doesn't have a status bar
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Hi!
I wrote an application where I draw an additional button to the caption of a dialog. This works perfectly for all versions of windows, even for XP when the "classic style" is used. But, if I select an XP theme, I run into a problem: When I handle the WM_NCPAINT message, the caption of the dialog (and also the frame) is not drawn using the corresponding visual style, it is drawn in "classic style"! This looks really ugly.
My SDK is up to date. I tried it with and without a manifest file, it makes no difference. I develop the code under win2k, using vc6. Maybe this is the problem: does anybody know, if this works correctly with vc7?
If anybody has an idea how to solve this problem, please help. I've been trying it for two weeks now any I'm out of ideas...
Thanks in advance,
Marcus.
|
|
|
|
|
AFAICT this is By Design(tm). Since themes change the look of the non-client area, when an app handles WM_NCPAINT (also to change the look of the non-client area), XP turns off the theme so the app's own painting takes precedence. Look at RealPlayer 8 for another example.
--Mike--
"Big handwavy generalizations made from a position of deep ignorance is one of the biggest wastes of time on the net today.
-- Joel Spolsky
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
|
|
|
|
|
Thank you for the answer, Mike.
Is it possible, to draw the nonclient area by hand using the correct theme? I know that I can use GetSystemMetrics() to get all dimensions I need. I also know that I can load the theme elements from the uxtheme.dll. But, I'm not sure how to apply them to the window. Do you know how to do that? Any code fragments, links to descriptions or articles would help, too.
Thanks again,
Marcus.
|
|
|
|
|
Hi,
I need to create about three to four modal dialog boxes such that when a button is pressed in the first one it leads to the next and again when a button is pressed in this it leads to the next one and so on..I am a novice in this field and I need some help in this. I tried this:
void CNewoneDlg::OnOK()
{
CDialog aboutDlg(IDD_DIALOG1);
INT_PTR pRet=-1;
aboutDlg.DoModal();
//CDialog::OnOK(); (I tried taking this off...but didnt work either)
}
This works..it leads to the next dialog box on pressing ok..
but..
void CDialog1Dlg::OnOK()
{
CDialog aboutDlg(IDD_DIALOG2);
INT_PTR pRet=-1;
aboutDlg.DoModal();
//CDialog::OnOK();
}
This doesnt lead to the next dialog box on pressing ok..I am confused, since I have used the method in the earlier function..when that can work, why cant (isnt) this?
I desperately need a help..
THANKS
Deepak Samuel
|
|
|
|
|
how do i cast a cstring to bstr?
and from a bstr to cstring..
thanks
|
|
|
|
|
Make BSTR from CString:
Use either CString member function BSTR AllocSysString ( ) const; or BSTR SetSysString( BSTR* pbstr ) const; .
And the other way, I don't really know, but perhaps a simple '=' is enough?
CString strBla = bstrString; ?
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
|
Thanks people...you are great people to have around..
it worked!
kindest regards
|
|
|
|
|
Well, there are no casting routines.
But you can use these conversion methods of CString:
CString to BSTR: AllocSysString
BSTR to CString : SetSysString
Or you use the _bstr_t class declared in <comdef.h> ,
which is very comfortable.
Jens
|
|
|
|