|
Todd Smith wrote: Is it possible to uninstall SV2003 SP1?
Only if it's listed as a separate product in the Add/Remove Programs applet. Otherwise, you'll need to uninstall all of VS, which would include the SP, and then install VS from scratch.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I've looked and don't see a specific item in Add/Remove so I was checking here before I went through the horrible task of reinstalling VS2003. Maybe, hopefully, I missed it in add/remove.
Todd Smith
|
|
|
|
|
Hello everyone!
I have developed an SDI application with MFC, not supporting doc/view, then i made some modification to convert it to MDI, and everything works fine.
Now the weird:
My boss asked to make some trick so that someone could decide in RUNTIME to run the SDI or the MDI version. My first idea was to create 2 classes, CMainFrameSDI->CFrameWnd and CMainFrameMDI->CMDIFrameWnd and instantiate them into the global CApp, taking care to avoid the inizialisations not needed by the MDI and vice versa.
One other thing i did was creating a pure abstract class, CMainFrame, with only methods and only public functions, and deriving both CMainFrameSDI and CMainFrameMDI EVEN from it.
Inside the application the class used is then a pointer to CMainFrame and in case of specific functions it becomes its SDI or MDI version, depending on a flag present in all the three classes.
Everything explode suddenly....
I tried to build a sample with all this stuff but everything explode apparently without any cause into the LoadFrame. The only thing that i can notice is at a certain point unexpectedly the m_hWnd member of the SDI/MDI (depending on what started) become null...
I know i am doing bad things... but someone every did something like this just to take some advice on how to do such thing?
If u need i can provide my sample to give it a check
Best regards &cheers to everyone
A bleeding programmer with a big headache!!!
-Yes, i don't write a good english-
Unlukily it's not a Joke...
Hope you'll understand!!
|
|
|
|
|
It sounds like you have a "production" application. If so I suggest you start a new research project that you use to solve this "new requirement" in isolation from your working application. Once you have an understanding of the problem and the potential solution(s), you can attempt to modify the existing application to implement the solution.
led mike
|
|
|
|
|
|
Is the resource ID valid when you call LoadFrame?
Do you need to be able to switch back and forth between MDI and SDI or just decide at startup?
If just at startup, you should be able to do this in InitInstance() of the app:
CFrameWnd *pFrameWnd = 0;
if (fUserWantsMDI)
pFrameWnd = new CMainFrameMDI;
else
pFrameWnd = new CMainFrameSDI;
if (!pFrameWnd)
return FALSE;
m_pMainWnd = pFrameWnd;
if (!pFrameWnd->LoadFrame(IDR_MAINFRAME))
return FALSE;
|
|
|
|
|
Mark Salsbery wrote: Do you need to be able to switch back and forth between MDI and SDI or just decide at startup?
I based my post on the subject, "Runtime change MDI/SDI" being accurate. Perhaps that was a mistake.
led mike
|
|
|
|
|
Dammit!
|
|
|
|
|
Endaroza wrote: CMainFrameSDI->CFrameWnd and CMainFrameMDI->CMDIFrameWnd
Why not make your derived class a template?
|
|
|
|
|
If you are not supporting the Doc/View architecture then this should be pretty easy. Create your app as an MDI app. When using MDI you show your "view" in MDIChildWnd frames. When using SDI show your view in a subclassed MDIClient window.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Solved finally (sorry for the sooooo late answers but i changed the email and i did not received these stuffs) anyway. The solution i found is to take my existing CFrameWnd derived class (CMainFrame), then i created a CMDIFrameWnd derived class (CMDIMainFrame). I moved all the variables inside another class, friend of the two above (CMainFrameVars), and added all the getters/setters to CMainFrame. At this point my old CMainFrame has not one single class variable, and access these variables (even internally) only through the getter/setter functions.
I barely copied all the methods declarations from CMainFrame to CMDIMainFrame header, and vice cersa, now the two classes has exactly the same functions declarations.
After this step i modified the CMDIMainFrame cpp: now it's EMPTY it contains only #include "MainFrm.cpp", #define CMainFrame CMDIMainFrame, #define CFrameWnd CMDIFrameWnd.
Now i have 2 separate classes, exactly the same code, the only difference is inside the header!!
-Yes, i don't write a good english-
Unlukily it's not a Joke...
Hope you'll understand!!
|
|
|
|
|
Would anyone know how to do this, or have any pointers on it:
using getpixel read a pixel on the screen, then do if 3<g<255
so="" basicly="" if="" a="" pixel="" contains="" hint="" of="" green="" execute="" some="" code?=""
thanks
="" johannes=""
<div="" class="ForumSig">/Johannes
|
|
|
|
|
if (GetGValue(GetPixel(hdc, xpos, ypos)) > 0)
{
execute some code
}
|
|
|
|
|
whats the hdc bit?
thanks
/Johannes
|
|
|
|
|
Handle to a device context for the screen.
HDC hdc = GetDC(0);
You asked about reading a pixel from the screen, yes?
Mark
|
|
|
|
|
Or you can use GetGValue(GetPixel(GetDC()->m_hDC,x,y));
|
|
|
|
|
>>Or you can use GetGValue(GetPixel(GetDC()->m_hDC,x,y));
But that's a window pixel, not a SCREEN pixel lol
|
|
|
|
|
I have tried to rotate an image using GDI+ but I have trouble understanding how to do it. Some examples describe calling TranslateTransform() before calling RotateTransform(). The MSDN files are not clear on this. I do all the drawing in a CView from OnDraw().
I would really appreciate clarification on this.
Thanks!
"Eat till you're sleepy, sleep till you're hungry." - Mark
|
|
|
|
|
Disclaimer : I hate it when I cannot put into "good" words what I'm trying to explain.
Me think, you need to translate to the origin, otherwise, the image will be rotated around the origin, and if it's not it will be what you expect the rotation to be.
or, the image will not be rotated against its center point like you expect.
|
|
|
|
|
Maximilien wrote: Me think, you need to translate to the origin, otherwise, the image will be rotated around the origin, and if it's not it will be what you expect the rotation to be.
Are you suggesting that my image is there, but rotated out of the view (origin problem)?
"Complexity breeds problems. Keep it simple." - Mark
|
|
|
|
|
|
The rotation will be around the origin. You're probably after a rotation around the center of the image. Try something like this.
graphics.TranslateTransform(-cx, -cy);
graphics.RotateTransform(30.0f, MatrixOrderAppend);
graphics.TranslateTransform(cx, cy, MatrixOrderAppend);
Where cx and cy are the center of the image (the point you wish to rotate around). This code builds a transformation that effectively translates the image so that the point you want to rotate around is at the origin, rotates around the origin and then translates the image back to its proper location.
Steve
|
|
|
|
|
hi,
I am using function EnumDisplaySettings to get Windows resolution
like this:
DEVMODE dm;
dm.dmSize = sizeof(DEVMODE);
dm.dmDriverExtra = 0;
EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dm);
..and resolutin is in dm.dmPelsWidth and dm.dmPelsHeight
It works fine in WinXP - I am programming it, but
i need to run it on Windows 95 and even function return TRUE
the values in DEVMODE are nonsencical and probably random.
Does anyone solved this problem?
Or know any other function to get resolution in Win95
Thank you
viliam
|
|
|
|
|
Why not use GetSystemMetrics() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I try to hook the window of a service with WH_CBT system hook, but it doesn't work.
|
|
|
|