|
I associate rtf files with my app.I want to add the same property sheet that Microsoft has implemented for Word when you right click on a doc file and appears a property sheet called Summary.How can I do this?Thanks a lot.
|
|
|
|
|
Call ShellExecute() with the "properties" verb.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I have found on codeguru in Shell section something but it is an ATL project.How can i convert it to a MDI project?
Thanks.
|
|
|
|
|
Hi all..
How can I change bg color in SDI?
I know that I can do it by handling WM_ERASEBKGND message
My code look like this
BOOL CSomthingView::OnEraseBkgnd(CDC* pDC)
{
CBrush br(RGB(127,127,127));
CRect rc;
GetClientRect(&rc);
pDC->FillSolidRect(&rc,&br);
...
...
return TRUE;
}
But when this code is called.. Windows fliker..
How can I change that code..?
What I thought is that I can do it by changing WNDCLASS's hbrBackground
But I have no idea how to do it?
Is there better way to do it?
|
|
|
|
|
Changing the WNDClass would not help you, you'll get the same flicker. Basically, you have two ways to go:
1. Just return TRUE from OnEraseBackground, and draw all of the view in OnDraw instead. Preferably to a memory CDC. See http://www.codeproject.com/gdi/#Device+Contexts[^] for such a beast.
2. If the view contains controls, you might want to add the style WS_CLIPCHILDREN to the view.
|
|
|
|
|
How can i change the text color of a static control on a dialog box, From the dialog class.
i.e, i want to make the text color of the static control to blue. I have a variable for the static control
CStatic m_cStaticName; attached to the control.
thanks in advance..
|
|
|
|
|
You have more articles than you can comfortably shake a medium-size stick at here: http://www.codeproject.com/staticctrl/[^]. Basically, you want to derive your own class from CStatic , and handle the reflected WM_CTLCOLOR message.
|
|
|
|
|
I exactly dont want to subclass. I want it to be done from Parent dialog class.
any way.?
|
|
|
|
|
Subclass anyway
You are supposed to subclass. You can have the coloring control in another dialog. You can move it to another project. Ok, you don't want to listen? Then, handle WM_CTLCOLORSTATIC in the dialog. Use SetTextColor on the CDC if the control ID equals the static control (you should change it from IDC_STATIC ).
This is bad practice, couples the dialog to the static. You have to repeat the code for all dialog you build where you want coloring in the future. You have to add tests to the code if you add more coloring statics. Now you've been warned
|
|
|
|
|
Sir,
I have a dll named Dll.dll.
There were no errors at build time.
Later on when I wanted to access the functions of this DLL through client,Then a Runtime error -Bad Image occured.
The contents of this message are -
"The application or DLL C:\\WINNT\\Dll.dll is not a valid Windows image.Pls check this against your installation diskette."
What should I do?
Why this occurs?
|
|
|
|
|
Hello!
I'm not sure but check these things:
1st. Have you written the dll by your self? -> Check that the Functions are exported (or something like that i don't know exactly the name)
2nd. Have you set the extra path for the dll directory?
3rd. Is there a lib File which you have to include?
4th. Is the dll File in the Debug folder??
I hope it helps!
Ronny
|
|
|
|
|
Hi,
I have a singleton class. I need to access the static getInstance() from another file. The singleton class is defined in another file.
I suppose the static variables and methods have file access.
Thanks,
Venkat SR
|
|
|
|
|
Add the #include diective in the .cpp where u want to create the singleton class.
|
|
|
|
|
#include "singletonFile.h"
Single one ;
if(one == NULL)
one = Single::getInstance();
else
return one;
|
|
|
|
|
Hi,
Thanks for reply,
Class B is singleton. This has static getInstance().
I want to access getInstance() of Class B in Class A. Class B header is included in Class A.
When i do this, it gives linker error LNK2001 unresolved external symbol getInstance().
This error occurs for other non-static functions of Class B, when called from Class A.
Thanks,
Venkat SR
|
|
|
|
|
the format is classB::getInstance.
Note that you have to prefix the class name than :: than getInstance.
If you are doing that, double check your includes. Make sure you haven't accedently #IFed the class out somehow.
|
|
|
|
|
hi everyone,
I have 2 application : app1.exe and app2.exe. how can i launch them at the same time?
if i write:
system("app1.exe");
system("app2.exe");
then, app2.exe can only be executed after app1.exe finishes. is there anyway to resolve this problem?
thanks everyone in advance.
regards,
ken
|
|
|
|
|
How about CreateProcess?
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
"Philosophy is a study that lets us be unhappy more intelligently."
-Anon.
|
|
|
|
|
Hi ken
I've done something you want to do.
My Way : in OnNewDocument you must insert a line like
WinExec("app2.exe", SW_SHOW);
Then you normally start your app1 and the programm itself starts app2
regards
yummi
|
|
|
|
|
i m using VC++ 6 n DirectShow for video capture
i change the debug mode configuration to Release mode
there are warnings as follows
now wt should i do ?
R they have effect on my program or not.
Linking...
LINK : warning LNK4089: all references to "ADVAPI32.dll" discarded by /OPT:REF
LINK : warning LNK4089: all references to "OLEPRO32.DLL" discarded by /OPT:REF
LINK : warning LNK4089: all references to "WINMM.dll" discarded by /OPT:REF
cam.exe - 0 error(s), 3 warning(s)
|
|
|
|
|
No problems there. The compiler has optimised in such a way that it no longer needs those libraries, so it has removed all references to them. Since you weren't using the libraries anyway, it won't make any difference at all. It wouldn't show this in Debug mode because the compiler was probably not optimising your code.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
CDC memDC;
memDC.CreateCompatibleDC(NULL)
I made memory dc with Parameter NULL, which means SYSTEM compatible DC as far as i know..
Because I can't use View's DC in my module that manipulate Bitmap..
And then I made CBitmap..
CBitmap bitmap;
bitmap.CreateCompatibleBitmap(&memDC, 200,200);
But What I noticed here is the bitmap that I've just created is 1bit bitmap,
that is white-black bitmap..
I can not understand why..
I saw some source that manipulate bitmap like rotate.. stretch here..
That used same kind of memDC, which was created by the function CreateCompatibleDC with NULL Parameter..
The bitmap that source created was full color bitmap..
What's wrong with my code?
|
|
|
|
|
I've never used CreateCompatibleBitmap. Actually, I don't even use CBitmaps, I use DIBSections via a wrapper class. There are several on CP, but in the meantime, I'm pretty sure that bitmap has a constructor or a general Create call that will do what you want it to.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
johnny,Kim wrote:
But What I noticed here is the bitmap that I've just created is 1bit bitmap,
that is white-black bitmap..
I can not understand why..
This is documented in MSDN. When a memory device context is passed to CreateCompatibleBitmap() , a 1-bit bitmap is always created. To create a colour bitmap, pass in a device context referring to the screen or an actual device.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thanks you..
I should've checked MSDN.. Sorry about that I was lazy...
|
|
|
|