|
EricDV wrote: But, the documentation says:
CancelConnectNotify
The CancelConnectNotify function is implemented by applications that need to receive notification from the MPR when a network resource is connected or disconnected.
That same documentation states that it is called before and after each cancel connection operation (WNetCancelConnection() or WNetCancelConnection2() ). I just don't see how the un/plugging of a cable is going to mimic that.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
David,
It appears that you are correct. AddConnectNotify and CancelConnectNotify are not called when a network cable is plugged in or unplugged. I tried them out, and notification is only received when an application creates a network connection or disconnects an existing network connection - which has nothing to do with the network cable.
My misunderstanding...I'm stupid.
--EricDV Sig---------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters
|
|
|
|
|
|
Hi,
I am creating a program in Visual Studio 6.0. I am using MFC and Document/View architecture. I add the "Microsoft Web Browser" ActiveX control to the document window. Then I open an HTML document in this window. This HTML document has an embedded ActiveX control object e.g. CExampleActiveXCtl in it. I want to send and receive data to this embedded object from my program. How do I get the pointer to the embedded ActiveX control object?
Any help will be greatly appreciated.
Thank you in advance,
Regards,
RS
|
|
|
|
|
The only I know is that you can first locate your ActiveX control, which is defined with <OBJECT> element in HTML. You can try such functions like getElementById , getElementsByName or getElementsByTagName , member of IHTMLDocument3 . (You can obtain IHTMLDocument3 interface by querying the IDispatch object returned by get_Document function of the WebBrowser control).
After you locate the element, query for IHTMLObjectElement interface. Next you can use get_object member and obtain an IDispatch interface of embedded ActiveX. Then you can query this object for interfaces implemented by the control and manipulate it.
Unfortunately I do not know how you can attach the IDispatch object to an MFC ActiveX control and then work easier with class.
|
|
|
|
|
Thank you very much. That worked!
Regards,
RS
|
|
|
|
|
I'm trying to printout the time and date and i'm doing this:
<br />
#include <ctime><br />
<br />
char *tm = ctime(NULL);<br />
char *fileName = "";<br />
<br />
fileName = "C:\\output";<br />
strcat(fileName, tm);<br />
strcat(fileName,".txt");<br />
AfxMessageBox(fileName);<br />
but when I run it i get the following error:
Debug Assertion Failed!
ProgramL...
File: ctime64.c
Line: 90
Expression: (timp != NULL)
What am I doing wrong?
Kitty5
|
|
|
|
|
You are messing a little bit how strings works. I suggest you use the strings from the STL (std::string), they will manage all these problems for you.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
You did not allocate space for fileName . You can first try this:
char *tm = ctime(NULL);
char fileName[1000];
strcpy(fileName, "C:\\output");
strcat(fileName, tm);
strcat(fileName,".txt");
AfxMessageBox(fileName);
Then you can switch to CString :
CString s;
s.Format("C:\\output%s.txt", ctime(NULL));
AfxMessageBox(s);
And next you can make it work in both Ansi and Unicode versions:
CString s;
s.Format(_T("C:\\output%s.txt"), _tctime(NULL));
AfxMessageBox(s);
I hope it works.
-- modified at 10:10 Friday 30th June, 2006
|
|
|
|
|
Viorel. wrote: CString s;
s.Format("C:\\output%s.txt", ctime(NULL));
AfxMessageBox(s);
ok so I tried this but I still have that original error with the ctime() function of:
Debug Assertion Failed!
ProgramL...
File: ctime64.c
Line: 90
Expression: (timp != NULL)
Kitty5
|
|
|
|
|
This means that ctime does not accept NULL parameter. Try this:
time_t t = time(NULL);
and then path &t to ctime : ctime(&t) .
Hope it helps.
-- modified at 10:37 Friday 30th June, 2006
|
|
|
|
|
|
Pass NULL, get NULL. You should code this way:
#include <time.h>
time_t ltime;
time( <ime );
char *tm = ctime(<ime);
Best,
Jun
|
|
|
|
|
Jun Du wrote: time_t ltime;
time( <ime );
char="" *tm="ctime(<ime);" <="" blockquote="">
what is
|
|
|
|
|
In my previous post, can you see proper code? Your post looks weired here. There seem to be some problems with the posting, even I've disabled HTML tags. (I'm using Linux at work)
Anyhow, ctime(const time_t *time_val) works this way.
Best,
Jun
|
|
|
|
|
the code is see is:
#include <time.h>
time_t ltime;
time( <ime );
char *tm = ctime(<ime);
Kitty5
-- modified at 10:40 Friday 30th June, 2006
|
|
|
|
|
Ok, < should be &.
Best,
Jun
|
|
|
|
|
Don't use <> directly. Use the <> buttons above the smileys.
#include <ctime>
time_t t = time(NULL);
char *tm = ctime(&t);
char fileName[256] = "C:\\output";
strcat(fileName, tm);
strcat(fileName,".txt");
AfxMessageBox(fileName); Since you are using MFC, why mess with char* and strcat() ?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks for this DavidCrow wrote: Use the <> buttons above the smileys.
Best,
Jun
|
|
|
|
|
DavidCrow wrote: Since you are using MFC, why mess with char* and strcat()?
And on that note, why not just use CTime or COleDateTime? Both of which have format methods that will allow you to print out a timestamp in any format you wish.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Thanks you guys!
You all ROCK!
Kitty5
|
|
|
|
|
how we can put tooltips to the listbox items.
if i point to any particular item it must get tooltip and it will show the name of the item.
please help me,urgent.
murty.
vsn
|
|
|
|
|
See Here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
Hello
I want to take a snapshot from a webcam and save it to a file . but I dont know how to do it , can you help me?
thanks
|
|
|
|