|
ProgramA.exe is fine when it's run outside my MFC project.
The dos prompt works as it should when i call it explicitly but am getting problems when i call a program.
Also all windows programs are executing correctly.
I need ProgramA to work and hold until I have operated on it then i want to exit ProgramA and return to the MFC project.
Kash
|
|
|
|
|
Kash wrote:
I need ProgramA to work and hold until I have operated on it then i want to exit ProgramA and return to the MFC project.
I do not understand this sentence.
Do you want programA to start in a DosBox, perform its function and close the dosbox? This works on my computer.
Or do you need the dos box to stay open, to show the output of ProgramA?
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
the latter, as ProgramA requires user inputs and once these have been obtained, it can then perform it's function and be exited by the user.
|
|
|
|
|
Kash wrote:
ProgramA requires user inputs
Oh. I see.
From you first post ("It takes an input data file and outputs another data file.") on, I always thought of command line params.
For a test, I tried "more.com", (which also wants input) with ShellExecuteEx():
CString s ("C:\\WINNT\\system32\\more.com");
SHELLEXECUTEINFO SEI = {0};
SEI.cbSize = sizeof(SEI);
SEI.lpVerb = "open";
SEI.lpFile = s;
SEI.nShow = SW_SHOWDEFAULT;
BOOL err = ::ShellExecuteEx( &SEI );
if (err!=TRUE)
{
} and it seems to work. If this does not help, maybe calling a Batch-file that in turn calls your program may help?
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Thank you very much for your help.
kash
|
|
|
|
|
How can i convert a string represented by BSTR to char * ?
|
|
|
|
|
Just check out with W2A() ...
|
|
|
|
|
|
hello @all,
a few days ago, i asked:
i would like to build a hyperterminal into a mfc program (after i pressed a button, the hyperterminal is to appear).
how can that be done?
i got the answer:
::ShellExecute(0,0,"hypertrm.exe",0,0,SW_SHOW);<br />
it functions perfectly (special thanks to M A V)!
now, when the hyperterminal starts, i must make a few settings (select the com, give a name, baudrate and so on).
is there a possibility to load an old "test.ht"? i don´t want to make any settings at the beginning of the hyperterminal.
how can that be done?
thank you very much
sunny
|
|
|
|
|
Pass test.ht on the command line
::ShellExecute(0,0,"hypertrm.exe", "test.ht",0,SW_SHOW);
you may need to pass the full path to the test.ht file.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
thank you for reply, it functions perfectly.
i hope the last question to the hyperterminal:
is there a possibility that the hyperterminal window has full screen width?
thank you very much
sunny
|
|
|
|
|
thank you and i think i found it:
i use SW_SHOWMAXIMIZED to get the hyperterminal window has full screen width
and i think it works.
thank you very much,
sunny
|
|
|
|
|
hi,
i'm using ado to connect to my database. now i want to retreive a date from the _RecordsetPtr. how do i do this? I also want to do this with a Currency...
my code:
<br />
COleDateTime Date;<br />
Date = (????) pRecordset->Fields->GetItem("Date")->Value;<br />
[]D [] []D []
|
|
|
|
|
Personally, I use the function VariantTimeToSystemTime to convert the returned VARIANT_T into a SYSTEMTIME structure which can then be used by COleDateTime.
Michael
Wonder Woman, Wonder Woman.
All the world's waiting for you,
and the power you possess.
In your satin tights,
Fighting for your rights
And the old Red, White and Blue.
|
|
|
|
|
this might sound stupid, but it doesn't seem to work...
my code:
<br />
_RecordsetPtr pRecordset;<br />
<br />
LPSYSTEMTIME time;<br />
VariantTimeToSystemTime((double)pRecordset->Fields->GetItem("Datum")->Value, time);<br />
It crashes....
[]D [] []D []
|
|
|
|
|
That will be because "time" points somewhere invalid/undefined.
Try
SYSTEMTIME time;
VariantTimeToSystemTime((double)pRecordset->Fields->GetItem("Datum")->Value,&time);
That will work, unless the date/time stored is NULL.
Steve S
[This signature space available for rent]
|
|
|
|
|
I got another solution:
<br />
_RecordsetPtr pRecordset;<br />
<br />
COleDateTime date(pRecordset->Fields->GetItem("Datum")->Value);<br />
This works fine...
Thanks for your help,
Willem
[]D [] []D []
|
|
|
|
|
You can build a COleDateTime from a _variant_t , the type that is returned from pRecordset->Fields->GetItem("Date")->Value . So, your code could look like:
COleDateTime Date(pRecordset->Fields->GetItem("Date")->Value);
|
|
|
|
|
lol,
i just found that solution, look at the previous post...
thanks anyways...
willem
[]D [] []D []
|
|
|
|
|
How would one resize a CView derived view based on a LPRECT structure? I have tried using SetWindowPos() but with no luck.
Any help would be appreciated.
Thank you.
|
|
|
|
|
You need to resize the frame window that the view is inside.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
can you eloborate with some sample code. I was under the impression that I needed to resize the Frame window as well I tried to do
SetWindowPos(((CMainFrame*)AfxGetMainWnd()), 0, 0, 50, 50, NULL) to see if it worked.. but that didn't work.. I also tried SetWindowPos(GetParent()....) but that didn't work either.
|
|
|
|
|
To resize the view I'd try:
GetParentFrame()->SetWindowPos( &wndTop, 0, 0, 100, 100, SWP_NOACTIVATE | SWP_NOMOVE );
from within a derived CView class function. ie. 'this' = your view.
or use:
GetMyView()->GetParentFrame()->SetWindowPos( ... )
from code outside of the view.
Of course the parent frame needs to be in its restored (normal) size, not maximized for this to work.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
I'm a bit multibyte challenged -
I want to get the last char of a potential multibyte CString / LPCTSTR, specifically, check if it's a slash or backslash.
As far as I understand it, just using str[ str.GetLength()-1 ] could give me the second char of a multibyte sequence, which sounds bad.
So many people long for eternity that don't know what to do on a rainy sunday afternoon. [sighist] | [Agile Programming] [doxygen] If you look for evil in me you will find it whether it's there or not.
|
|
|
|
|
Hi
Suppose take following example ..
you can not say that
LPCTSTR str=_T("Test\");
You have to write
LPCTSTR str=_T("Test\\");
Here While considering the string "Test\\". it ignore the Last characher as it is from escape seqnence..I meant it has t0. And the results are correct.
ch=str[strlen(str)-1];
|
|
|
|