|
It's there solely as a test - the DoTest function should fire the connection point event and cause a message box, then I unadvise, because I'm not doing anything except trying to prove I can recieve an event.
Oh, no - it's not a thread issue, is it ? Is one thread trying to fire a CP and the main thread has shut it down ?
Removing the last three lines stops the crash, but my event is still not being called, my message box is not coming up from the MFC side, and tracing into Fire_DoTest() shows that it considers the number of active connections to be 0.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
It's been a while since I've used ConnectionPoints, tend to roll my own now but...
Does the AfxConnectionAdvise(pUnk, IID_ISAFileDBEvents, pUnkSink, FALSE, &m_dwCookie) return TRUE?
What if you change the bRefCount parameter to TRUE on the call to AfxConnectionAdvise?
Michael
|
|
|
|
|
You're absolutely right - it returns false, regardless of what I set that parameter to.
GetLastError tells me 'The Handle Is Invalid'.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I can't see anything wrong with the code. I think you need to put some error checking on the code prior to the advise. A few try and catch and checking returning values. Something is failing somewhere (obviously), but without being able to step through the code I can't suggest anything else at the moment.
Michael
|
|
|
|
|
Hi,
I know the name of the application i need to invoke say XYZ.exe I've been using create process giving it the full path of where the exucutable is located. Can Anyone help me out in Invoking this Exe (XYZ.exe) even if it is not in the current path. ie it resides somewhere in the "System PAth" I Have to get the Path of the executable. I've been looking at FindExecutable and AssocQueryString but i'm unable to understand them fully. i'd be very grateful if you could help me out
|
|
|
|
|
PROCESS_INFORMATION pi;
STARTUPINFO si;
// If your app need addiotional parameters, pass NULL in lpAppName and
// fill the lpCommandLine with full path name, and paramateres
// Else, fill the lpAppName with the full path name, and NULL in
// lpCommandLine
// With parameters
LPCTSTR lpAppName = NULL; // name of executable module
// If long path name used, you must double quoted the string
LPTSTR lpCommandLine = "\"C:\Program Files\MyApp.exe\" -L -S";
ZeroMemory(&pi,sizeof(PROCESS_INFORMATION));
ZeroMemory(&si,sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
CreateProcess(
lpAppName, // name of executable module
lpCommandLine, // command line string
NULL, // LPSECURITY_ATTRIBUTES lpProcessAttributes,
NULL, // LPSECURITY_ATTRIBUTES lpThreadAttributes,
FALSE, // handle inheritance flag
NORMAL_PRIORITY_CLASS, // creation flags
NULL, // new environment block
NULL, // current directory name
&si, // LPSTARTUPINFO lpStartupInfo,
&pi ); // LPPROCESS_INFORMATION lpProcessInformation
|
|
|
|
|
Your Question is that you don't Know where the exe is?
If this is your case, you Have a couple of directories where look for, or the app can be in any directory?
Best Regards!!!!
Carlos Antollini.
|
|
|
|
|
Try CFileFind(). Search MSDN for it.
Josh
josh@that-guy.net
|
|
|
|
|
Have a look at SearchPath and SearchTreeForFile.
Paolo
------
"airplane is cool, but space shuttle is even better" (J. Kaczorowski)
|
|
|
|
|
i'm in the midst of a mini project and i would like to know the library for graphics for Visual C.
library as like example: #include is for the standard input and output.
I would like to those who know to help me as i'm desperate!
Thank you!
Jan
|
|
|
|
|
What do you want this library to do ? What form does your project take (MFC/Win32/ATL/etc ) ?
GDI is there as standard, GDI+ requires you to install the platform SDK and distribute a DLL, it also does not work with Windows 95. You need GDI+ or an external library like CXImage to load and save images, but other than that I can't help unless you provide more info on what it is you need.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
thanks for replying!
i want to draw boxes with my own dimensions and maybe something like give the boxes a depression feel when the options entered from the key board.
|
|
|
|
|
the function is something like that:
void draw_menu(char na[])
{
settextjustify(0,0);
setcolor(LIGHTGREEN); //{
settextstyle(TRIPLEX_FONT, HORIZ_DIR, 5);
outtextxy(180,70,"Airlines"); //top inrroduction text
settextstyle(TRIPLEX_FONT, HORIZ_DIR, 5);
outtextxy(280,440,"Information"); //}
setcolor(15);//border
rectangle(0,0,639,479);
BOX(55,167,291,223,0,na[0],14,1,7,12); //display schedule function box
BOX(55,247,291,303,0,na[1],2,1,7,15); //display reserve function box
BOX(55,327,291,383,0,na[2],15,1,7,13); //display available function box
BOX(353,167,589,223,0,na[3],4,1,7,10); //display cancel function box
BOX(353,247,589,303,0,na[4],1,1,7,14); //display list function box
BOX(353,327,589,383,0,na[5],15,1,7,7); //display quit and save function box
return;
}
|
|
|
|
|
the function is something like that:
void draw_menu(char na[])
{
settextjustify(0,0);
setcolor(LIGHTGREEN); //{
settextstyle(TRIPLEX_FONT, HORIZ_DIR, 5);
outtextxy(180,70,"Airlines"); //top inrroduction text
settextstyle(TRIPLEX_FONT, HORIZ_DIR, 5);
outtextxy(280,440,"Information"); //}
setcolor(15);//border
rectangle(0,0,639,479);
BOX(55,167,291,223,0,na[0],14,1,7,12); //display schedule function box
BOX(55,247,291,303,0,na[1],2,1,7,15); //display reserve function box
BOX(55,327,291,383,0,na[2],15,1,7,13); //display available function box
BOX(353,167,589,223,0,na[3],4,1,7,10); //display cancel function box
BOX(353,247,589,303,0,na[4],1,1,7,14); //display list function box
BOX(353,327,589,383,0,na[5],15,1,7,7); //display quit and save function box
return;
}
and i am executing the program in dos mode.
|
|
|
|
|
A quick search of MSDN confirmed what I was pretty sure of - you're using functionality provided by your prior compiler. VC is not going to compile this code, and to be honest I have no idea how to draw boxes and so on in DOS mode. Why does your program have to be a DOS program ? How old is it ?
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
honestly, using this VC, it was implemented by my institue and the C language is in Windows u know like a browser kind and the program is executed in dos.......it's always in dos mode i suppose, but i know we can execute the program in windows mode but i neednt go to that yet for my project.
Jan.
|
|
|
|
|
Is this a dos program or a console application. What version of VC are you using? If it is Version 2 or greater I'd say you had a console application. Or is it using some kind of EasyWin library?
Michael
|
|
|
|
|
it's in Win32 console application
|
|
|
|
|
|
Just to add another lib: PDCurses is a free curses library (console "graphics", and windows...) that also works for Win32.
|
|
|
|
|
OK, lets say there is an IE (or maybe Netscape too, although, that will be later) window open. The page it has loaded contains a form with several edit boxes.
1) Is there a way for me to get the source of that page straight from IE (NOT by downloading it again)?
2) Is there a way for me to either:
a) Retrieve what information might be in those edit boxes?
and
b) Write info to those edit boxes?
Adam
cabadam@houston.rr.com
|
|
|
|
|
Hello,
I have had the same types of ideas in the past and here is what I did to resolve them.
I wrote some code that pulls the source html code from a provided url and dumps it to a text file.. I then parsed through the text file for the values I was looking for. (Getting the information in the edit boxes)
To post items to the edit boxes... When you enter items to a text box/form and press submit they are run as (what I call) a url string. To simulate filling out the boxes and pressing submit you would need to first figure out what the string would be then execute it, for example..
Lets say you have a web site with a user name and password field plus a login button.. The url string could look something like this http://www.something.com/login.dll?username=Bonehead&password=mypass, this could be in a round about way, simulating the filling out of the edit boxes and pressing the login button. I can provide you with some source code if this sounds like a valid solution for you.
Rob
|
|
|
|
|
This won't work for me- I need to manipulate a page that the user will already have open. I will not actually be submitting the information, and I can't retrieve the HTML from the server again. I need to see what IE itself has retrieved. The code will have come from a CGI script that output would differ if I simply gave it the URL.
Adam
cabadam@houston.rr.com
|
|
|
|
|
Hi group,
I am developing some time critical application. Now my question is
" When my application starts, user can't run any application in back ground. Even it can't pres ALT+TAB. Because if windows takes some time to switch my application fails because i am reading some data at miliseconds. Now what is the programming steps which i should take for this."
|
--------------------------------------------------
Say Whatever You Know
Manish
--------------------------------------------------
|
|
|
|
|
Don't use windows. If you have such a critical task, then a desktop OS like Windows is not suitable. Even when the user is not interfering there is no guaranty that the OS assignes enough CPU time to your application.
Regards Daniel
|
|
|
|
|