|
I have a SDI application .it's derived from CScrollView.I draw text with TextOut().while the the logical y-coordinate of the starting point of the text more than 32767,the text can't draw on the view.
How to resolve this problem?
|
|
|
|
|
hi there
i'm making a simple MFC Project.in which i have to give a menu option.when any user will click on this menu option then my sipX.exe file (which is small talking software) should be run in my MFC Application
i'm fadup how to do this.please somebody help me.guys i'm stuck on this point.
please help me.
byeeeeee
Aavesh
|
|
|
|
|
Use ShellExecute or CreateProcess .
Nibu thomas
Software Developer
|
|
|
|
|
Thanx for ur Reply.
i'm very new in VC++. i dont know how to use ShellExecute or CreateProcess with MFC classes.
please if could then give me some dtail information regarding these.
it would be heaven for me if u give me exat code for executing my exe when any user click on Run Menu option.
i have made my application using MFCApplicationWizard.exe.
its a MDI Application.
please help me.
thanx
Aavesh
|
|
|
|
|
::ShellExecute(NULL, "open", "the_path\\the_prog.exe", NULL, NULL, SW_NORMAL);
|
|
|
|
|
oh!!!!!
sorry.....i have done it.
very very thanx to u.
i hope u will reply me again.when i will ask my next question.
thank u very much boss
Aavesh
|
|
|
|
|
like this
PROCESS_INFORMATION pProcessInfo;
STARTUPINFO si= {0};
si.cb = sizeof(STARTUPINFO);
BOOL bStatus = CreateProcess("Notepad.exe",NULL,NULL,NULL,NULL,CREATE_NEW_CONSOLE,NULL,NULL,&si,&pProcessInfo);
|
|
|
|
|
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I know that one of the ways to draw on static controls is creating a CStatic Class and perform the paintings there (Overriding the OnPaint()).
How can I draw on an activex control?
thanx
llp00na
-- modified at 6:52 Thursday 30th March, 2006
|
|
|
|
|
Activexcontrols are COleControl derived classes and it si basically from CWnd . So u can use all the methods, msgs and overrides that u use for Cwnd . That means u can do the drawings in OnPaint , OnDraw , OnEraseBackGround etc..
cheers...mil10.
|
|
|
|
|
Okey mil10.
I am using an activex control (particularly a microsoft web browser) in an MFC application.
Can I place my drawings in the OnPaint() function of the dialog which holds the activex control ?? If yes, would it be drawn on top of the activex control or in the dialog's client area ???
thanx alot
llp00na
|
|
|
|
|
Hi all,
I have a problem and I hope you can Solve it for me,
I want to send a CWindowDC to another computer through network!!!
How can I do this?
Please help me,
Thanks.
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
Hum, and why do you want to do such a thing ??? You cannot do that. This is a device context and contains informations about your display and things like that. So it is totally ridiculous to send that on a network.
Why do you want to do such a thing ?
|
|
|
|
|
Maybe it is strange,
but I want to do this to send a picture to another computer (Desktop)
Is there a better way?
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
And why don't you simlply send the picture ?
|
|
|
|
|
Does anyone know whether it is possible to run an NT Service under a Windows Server 2003 environment. I have a Windows NT service created using the CNTService class that's been posted on the internet a number of times, and I am trying to run the same service under Windows Server 2003. Unfortunately a DLL that I create an instance for does not get created correctly.
Regards,
Simes
Simes
|
|
|
|
|
Simes wrote: Unfortunately a DLL that I create an instance for does not get created correctly.
Why? Are you receiving compiler/linker errors?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I can't seem to create the instance of the VB DLL that I am trying to access. It says it can't create the object, and yet I have an import statement at the top of my code for the NTService which ensure that the VB DLL is known about.
|
|
|
|
|
Simes wrote:
I can't seem to create the instance of the VB DLL that I am trying to access.
How are you trying to do this?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I have a VB DLL with a class know as clsMain. And within that there is a public sub routine called start which is then called from the NT Service.
In the NT Service when it runs it calls a procedure known as checkForFile. This checks a directory to see if a file exists. The directory in question is the ftproot one. I do a call to ::CoInitialize and then do a call to CreateInstance as follows;
hr = receiptThread.CreateInstance(__uuidof(clsMain));
The receiptThread object has been declared further up as follows;
_clsMainPtr receiptThread;
At the top of the code I have the following imports declared;
#import "c:\windows\system32\receiptThreadDLL.dll" \
no_namespace (The DLL in question has been already placed in the directory)
#import "C:\Program Files\Common Files\System\ADO\msado15.dll" \
no_namespace rename("EOF", "EndOfFile")
I then check the return value from the call to CreateInstance by doing the following;
if(FAILED(hr))
{
I write out to a log file the text "could not create receiptThread object in checkForFile()"
return;
}
|
|
|
|
|
Simes wrote: if(FAILED(hr))
What is the actual value of hr ?
That aside, why is the service itself not checking for the existence of the file?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
The value of HR is -2147221164 which seems to be related to a Class not being registered. But this is confusing as the same files work on an NT box without any problems. I have MDAC 2.8 loaded as well.
The service does do the checking for the existence of the file within the procedure checkForFile. It calls the VB DLL to then take the file, which is zipped up and extract it out and then load into an Oracle database. It's just that when the development was done for this (about 3 years ago) the extraction and loading of data into an Oracle DB was done in VB, and the people who were able to write service code at the time produced it in C++, so we had to ensure that the VB could get called from the service.
|
|
|
|
|
Simes wrote: The value of HR is -2147221164 which seems to be related to a Class not being registered.
Right. Have you registered the VB DLL (using regsvr32)?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Yep I have. I have created an unregister and register command file that calls regsvr32.
|
|
|
|
|
I am using CFileDialog for a "save as" where I have to choices for file types: All Files or Avi Files.
I just noticed something very strange and wondered if anyone else has seen the same thing, or better knows how to fix it.
First of all, the "save as" function is done correctly, so 99% of the problem is solved.
It comes up with All Files and indeed shows all files. The problem comes when I change to show only avi files. The window goes blank. If I go back to all files, it stays blank. Only if I choose a different folder is it refreshed properly (with either all or avi files).
I tried it in Paint and there if you change the file type, the window refreshes correctly. In CFileDialog it doesn't.
My code is:
CFileDialog filedlg( FALSE, "avi", // default extension
"mip1.avi", // current file name
OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_LONGNAMES,
"All Files (*.*)|*.*|Avi Files (*.avi)|*.avi||", NULL);
Has anyone else seen this, or can tell me what is wrong?
Thanks,
Ilan
|
|
|
|