|
I have written a nice IDE for a language that I have created. The only problem I have is that when I compile it does it all through DOS. Is there a way I can capture that ouput kthe way Visual Sutdio does and show the compilation in a window?
|
|
|
|
|
Doing this is actually fairly simple; all you have to do is redirect the processes STDOUT. You can do this by creating an anonymous pipe and using the handles that are returned in a call to CreateProcess. You can then use regular file factions to read the output out of the 'read' handle.
I have some code that will do this, let me know if you'd like a copy.
-Ben
---------
On the topic of code with no error handling -- It's not poor coding, it's "optimistic"
|
|
|
|
|
Here’s my scenario: I have an application that can save/load project files. I want to be able to register the icon and file extension (*.kkp) with the system so that you can open them directly from within Explorer, and have my app load, but not try to load the project as a document. Instead, I need to be able to detect the file is a project file and then handle it myself.
I know this is possible – I even managed to do it in a previous app I was working on, but now I can’t remember how to do it. Can anybody help?
Yours,
Peter
|
|
|
|
|
I'd appreciate ANY assistance here -
My task involves displaying file properties for files my application creates. I need to figure out how to persist the data in such a way that Windows Explorer could get it (via third mouse click, Properties). I am so lost on this project, so imagine a rather stupid 10 year old trying to do this.
Thanks,
Lilian
|
|
|
|
|
|
Thank you SO much. I REALLY appreciate your reply.
You don't know how much of a weight you lifted off these shoulders.
Thanks,
Lilian
|
|
|
|
|
I'm sure glad this fourm exists..
Im trying to parse a string for "11" and put the value into a int.. here what I have so far..
CString strPDT;
strPDT = "<p>At the tone, the time will be... < b>Wednesday, Jul 11, 2001 07:57:09 PDT< /b>";
int nIndex, nFirstIndex, nSecondIndex;
nIndex = strPDT.Find(_T("tone"));
nFirstIndex = strPDT.Find("< b>", nMyIndex);
nSecondIndex = strPDT.Find(",", nFirstIndex+1);
strPDTDays = strPDT.Mid(nFirstIndex+1, nSecondIndex-FirstIndexPDT-1);
int iPDTDays = atoi(strPDTDays);
int iPDTD = iPDTDays;
I know this code isn't correct but it gives you a idea of what I'm trying to do... can someone post some code that would find "11".
Thanks again,
Rob Jones
|
|
|
|
|
For Claryfy.
You need to get the day number in the string: At the tone....?
The string has the same structure?
For example: At the tone, the time will be... + date + time
Carlos Antollini.
|
|
|
|
|
Yes I need to pull "11" from the string and at the tone.. will always stay the same.. sorry about the terrible looking post, that string that I posted has html values in it and when posted the forum didnt display the html it used the html and made the post bold.. I'll try to fix how it looks. (I Fixed how it looks)
thanks
|
|
|
|
|
Do you like this?
strPdt = "At the tone, the time will be... < b>Wednesday, Jul 11, 2001 07:57:09 PDT< /b>";
CString strTemp = strPdt.Mid(strlen("At the tone, the time will be... < b>"))
//Now you have the date and time in strTemp.
int nfirst = strTemp.Find(",");
int nSecond = strTemp.Find(",", nFirst + 1);
int iPDTDays = atoi(strTemp.Mid(nSecond - 2, 2)); //if the number is < 10 you will have " 9".
Note. I wrote the code here, check if all is OK.
Good Luck
Carlos Antollini.
|
|
|
|
|
THANKS! works great
|
|
|
|
|
You're probably already using the strtok solution that Carlos gave you, but I submitted an article here that deals specifically with parsing strings. You may want to check it out.
http://www.codetools.com/useritems/cstringparser.asp
|
|
|
|
|
I am trying to create a Hyper object which has several Hyper objects as members. I then want to add the container object to the view and have all the contained objects added automatically. I want to be able to move the contained objects in unison with the main object. I don't know if this is possible but I would prefer using this method as opposed to using groups. If what I want is not possible, is there a way to access properties of individual objects by right-clicking on the object without ungrouping the group?
|
|
|
|
|
I have just upgraded my operating system to Windows 2000 and when I try to compile any programs that compiled and ran before I get a compile error 1001. I have even created a new empty program and this doesn't even compile. Obviously I need to change some sort of settings to make it compatible because these programs work on my colleague's version of 2000 so its just my machine.
Thanks for any help
Nick
|
|
|
|
|
Hi all,
In MFC, ON_MESSAGE() macro can be used to map userdefined messages. In ATL, what is the alternative macro for handling user defined messages?
Regards,
Rejeesh
|
|
|
|
|
MESSAGE_HANDLER(WM_MYMESSAGE, OnMyMessage )
and the function prototype is
// LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
|
|
|
MESSAGE_HANDLER(WM_MYMESSAGE, OnMyMessage )
and the function prototype is
// LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
|
|
|
MESSAGE_HANDLER(WM_MYMESSAGE, OnMyMessage )
and the function prototype is
// LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
|
|
|
|
|
|
Hi All,
My problem is about casting between these types.
the scenario is below.
getdocument -> getactiveelement ->
"it's a frame" I need a way of casting this IHTMLElement to IHTMLElement2 or to IHTMLWindow2
/*
IHTMLElement* pa_el;
...get_activeelement(&pa_el);
CComQIPtr<ihtmlelement2,&iid_ihtmlelement2> pa_el2(pa_el);
I have a dispatch here in pa_el2 but it seems as something is wrong because when I call doScroll, I get errors... if I cast to IHTMLWindow2... it simply returns NULL... (myframe == null)
CComQIPtr<ihtmlwindow2,&iid_ihtmlwindow2> myframe(pa_el);
How can I access to a frame object if I have it as an IHTMLElement?
Please Help...
|
|
|
|
|
If you need IHTMLElement2 just ask for it. IHTMLElment2 inherits from IHTMLElement
IHTMLElement2* pElement;
get_ActiveElement(&pElement);
|
|
|
|
|
I tried it already... but I get this error...
error C2664: 'get_activeElement' : cannot convert parameter 1 from 'struct IHTMLElement2 ** ' to 'struct IHTMLElement ** '
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
|
|
|
|
|
Gurus
I have been trying unsuccessfully to use CFileFind to search a directory for files, I have successfully used this in the past but currently have hit the proverbial brick wall. The following code
CFileFind find;
find.FindFile(m_strDir);
while (find.FindNextFile())
{
if (!find.IsDots() &&
!find.IsDirectory())
{
CString strMsg = find.GetFilePath();
strMsg += " found.";
AfxMessageBox(strMsg, MB_OK | MB_APPLMODAL | MB_ICONSTOP);
}
}
find.Close();
should return all files that aren't current directory (.), parent directory (..) or a directory. All I get returned is . and ..
Any idea what I have screwed up?
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
you need to call FindFile() first before you call FindNextFile()
i.e)
if ( ff.FindFile() )
{
while(ff.FindNextFile() )
{
do something
}
do something
this handles the last
file found case
}
|
|
|
|
|
If you have a look at the second line of code you will see that I have called FindFile(), I just didn't rap it up with an if statement.
Anyone else got any suggestions?
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|