|
This maybe too late but good for some old MFC folks like me:
If the file does not exist, create it using CStdioFile:
if (!pfile.Open(fileName,CFile::modeReadWrite))
{
pfile.Open(fileName,CFile::modeCreate|CFile::modeReadWrite);
}
pfile.SeekToEnd();
MFC forever!!!
henryh
|
|
|
|
|
Can anyone give me an idea of some ways to prevent Windows from running applications - all executables???
Thank you in advance...
"Needless redundancy is the hobgoblin of software engineering." - Peter Darnell
|
|
|
|
|
Which Windows, what EXEs, WTF do you mean man??!!
Details baby, details....
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
I have wondered this myself and although I have never tried to implement anything I have considered the following as options.
1) Inject some machine code inside each exe calling PostQuitMessage(0)
2) Iterate the processes currently running using a timer and determine which should run or not.
3) You might be able to prevent users from running applications by clicking desktop icons, I think you would wanna read up on shell extensions for more info on how to do this...
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
I would look into replacing the windows loader. That way you can decide who gets loaded, from EXE to DLLs.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi!
Is there a way to open a VC7 workspaces with VC6? Is there a converter?
thanks in advance
modified 12-Sep-18 21:01pm.
|
|
|
|
|
There is no known VC++7 --> VC++6 project converter.
I am building a converter. It will be available next week (probably).
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
cool
I just found out that it is also possible to create a new VC6 workspace and add all source files from the VC7 project. It works
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Gregor S. wrote:
I just found out that it is also possible to create a new VC6 workspace and add all source files from the VC7 project
A VC project is not only a set of files, it's a full makefile. You won't be able that easy to target a given set of files to produce for instance a DLL with shared MFC.
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
I want the WebBrowser control to draw on my provided window (Static Control) instead of its own window. The actual thing I want to do is to make the WebBrowser invisible and display its contents on my Window.
I have tried exchanging window handles b/w WebBrowser and my Static control but it crashes program. This thing doesnt crash for exchange b/w two static controls and i get to draw what one static is drawing on other one by such exchange. But i want webbroser to draw on my window.
Isnt there anyway tht we override Device Context of WebBrowser.
Anythought are appreciated.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
The web browser is hosted by an ActiveX control site, like any ActiveX, which hides all the complexity of the underlying windows, hence dc and stuff like that. Very unlikely you get to do what you want.
You could ask for the web browser to print (draw to a print dc), while you have selected a fake virtual printer, which you actually control. IMHO, this requires a printer driver (.vxd or something like that), ... Lotsa work!
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
I will try it.
Thanks.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Hi.
I tried to use CWindow::Print like this by first making the browser window invisible.
So i had no browser shown and still I could get a copy of image on my DC like this.
<br />
m_webBrowser.Print(pMyDC,PRF_CLIENT);<br />
Thanks your idea saved me days.
;););););););););););););););););););););););););)
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
What would make the right context menu that I custom wrote sometimes not show up? It can be doing finec and then sometimes it decides to just not appear anymore. Can I do anything to prevent this?
CMenu menuPopup;
if( rcTHBImage1.PtInRect(point))
{
menuPopup.LoadMenu(IDR_MENU1);
CMenu *pSubMenu = menuPopup.GetSubMenu(0);
CmdRouteMenu(pWnd,pSubMenu);
pSubMenu->TrackPopupMenu(TPM_RIGHTALIGN, point.x, point.y,this,NULL);
}
Thanks,
ns
|
|
|
|
|
Well, there are plenty of things that can cause the menu to not show up (the point is not in the rect, the menu couldn't be loaded, the submenu doesn't exist, etc).
When you encounter a situation like this where the expected doesn't happen, it's best to write the code snippet defensively (in fact it's a good idea to always write defensive code), using ASSERT and VERIFY to check that things are OK. Use TRACE to trace control flow. Here's what I mean:
if (rcTHBImage1.PtInRect(point)) {
TRACE ("Point is in rect...\n");
CMenu menuPopup;
VERIFY (menuPopup.LoadMenu (IDR_MENU1));
CMenu *pSubMenu = menuPopup.GetSubMenu(0);
ASSERT (pSubMenu != NULL);
CmdRouteMenu (pWnd,pSubMenu);
TRACE ("About to display popup menu...\n");
pSubMenu->TrackPopupMenu (TPM_RIGHTALIGN, point.x, point.y, this, NULL);
}
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I am making changes to my database. Its very peculiar that sometimes the changes get made quickly (I have the table open so I can look at it and it changes on the fly fast. Other times, its the same field I'm changing, and the new d ata takes ages to appear. If I keep the table closed and reopen it to check on its new value, sometimes the changes havent been made and I have to give it more time before I open it to check. What makes it take this varying amount of time to do the same thing? Other database operations are very swift. All I am doing is:
KeyValueMap::iterator it = m_EditkeyValueMap.begin();
for (; it != m_EditkeyValueMap.end(); it++)
{
CString key0 = (*it).first;
CString value0 = (*it).second;
if (value0=="") value0 = "_";
key0.TrimLeft();
key0.TrimRight();
key0.Replace(' ', '_');
char* key = new char[key0.GetLength()+1];
char* value = new char[value0.GetLength()+1];
strcpy(key,key0);
strcpy(value, value0);
m_pRecordset->Fields->Item[key]->Value = value;
delete[] key;
delete[] value;
}
m_pRecordset->Update();
Thanks,
ns
|
|
|
|
|
MFC 7.0 I read that MFC 7.0 supports OfficeXP look?
Is that true? How to do it if it is true?
|
|
|
|
|
Can anyone tell me how to open and print pdf files programmatically?
I only need to open it and then print it.. I dont need any other things to do just to print it...
thank you
|
|
|
|
|
I'm not sure but, if you visit Adobe.com I think they offer an API for working with their PDF files.
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
yes i did and tried OLE automation. But it didn't help me. Someone in Adobe Forum responsed my question of " why I can't call functions of Adobe Acrobat Classes? ", as Adobe Acrobat doesn't not support OLE yet.
But I found how to print pdf file using commandlines. Those command lines are:
Acrobat.exe /t filenameWithpath printername drivername portname
what this command line does is :
1) initiates Acroat
2) print a file
3) then terminates Acrobat
first 2 steps done perfectly but step 3) closing Acrobat never happened.
don't know why.
I was so happy when I found out this command because all steps are exacatly what I want. open, print, and close. But closing doesn't work with this command as it is stated in "Acrobat Developer FAQ Document".
Do you know how?
Thanks
|
|
|
|
|
I want to write a Activex Control that use some standard control,so i want to use the method in microsoft Knowledge Base Article Q155973.but i can't found this Article in microsoft's web site.
I decided to write a custom AppWizard to support this type ActiveX.I haven't created this type project ever.
the steps i used is:
1.open the AppWizard,select Custom AppWizard projects type ,project name is "Test"
2.select the Standard MFC Appwizard steps
3.select the MFC Appwizard Dynamic Link library then click finish button.
4.click oK button,then i have a blank project.
5.Then press F7 to complier this project.
report these error message:
error C2061: syntax error : identifier 'IBuildProject' in file Testaw.h ;
class CTestAppWiz : public CCustomAppWiz
{
public:
virtual CAppWizStepDlg* Next(CAppWizStepDlg* pDlg);
virtual CAppWizStepDlg* Back(CAppWizStepDlg* pDlg);
virtual void InitCustomAppWiz();
virtual void ExitCustomAppWiz();
virtual void CustomizeProject(IBuildProject* pProject); ///this line.
protected:
CDialogChooser* m_pChooser;
};
I don't know what cause this error.I don't change any files created by AppWizard.
who can help me?
win2000 pro(sp1) + visual studio 6.0(sp5) +2001.8 platform SDK
English isn't my native language,sorry for my bad english.
thanks alot
|
|
|
|
|
I want to know the function using load picture such as GIF, JPG, BMP and PNG.
Please somebody tell me.........................
Thank a lot.
|
|
|
|
|
It depends on what DirectX graphics module you are using.
Are you using Direct3D? Then, the interface ID3DX has several functions to load BMP, PNG, and JPG (but not GIF) as 3D textures. These textures can then be rendered in a 2D mode by using D3DXSprite. (If you do search engine requests on these terms, you could probably use the bulk of other people's code to try it out.)
If you're using DirectDraw, then you're on your own in terms of finding functions to decompress graphics files. I suggest looking into the FreeImage library. (Go to www.6ixsoft.com for more info.)
|
|
|
|
|
I've written a dll with ATL.I want to use it in Delphi.Is that possible?
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Sure. Just make sure to export your functions with _stdcall
This is the way how I did it
regards
Greg
modified 12-Sep-18 21:01pm.
|
|
|
|