|
Yeah, I do exactly that. The call to the constructor is:
CIgnorantInetSession session(0, 1, PRE_CONFIG_INTERNET_ACCESS, 0, 0, INTERNET_FLAG_ASYNC);
session.EnableStatusCallback(TRUE);
It should work just fine, but it still doesn't.
|
|
|
|
|
Where does it assert?
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
|
That's not helpful. Please post the exact condition that asserted. My INET.CPP line 415 is the arglist of the constructor.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Debug Assertion Failed is the message, then a generic RTFM blurb. The actual assert statement is:
ASSERT((dwFlags & INTERNET_FLAG_ASYNC) == 0);
|
|
|
|
|
I recall this annoying problem - caused by bogus MS doc. Hang on a sec while I find my fix...
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Can you try using INTERNET_OPEN_TYPE_PROXY instead of INTERNET_FLAG_ASYNC ?
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
This[^] is the query similar to yours. I wish MS would fix their online docs.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Still no go. Now I get an assert error in inet.cpp, 645 (when I enable the callback). The line is:
ASSERT(!m_bCallbackEnabled);
|
|
|
|
|
Ugh. I'm going to dig some more...
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Here's[^] an alternate approach. I'm still looking for the fix...
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Apparently asynch support in CInternetSession has gone away. See this MSDN link[^].
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Humor me one more time. Can you try this:
CMyInternetSession::CMyInternetSession()
: CInternetSession
("FooBar", 1, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0)
{
EnableStatusCallback (TRUE);
} /ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Seems to work for me! My callback gets called.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
You're gonna hate me... but it still doesn't work . Several callback events get fired correctly, but then an assertion fails again that looks like:
ASSERT(m_bCallbackEnabled != NULL);
And the bigger problem is that the call now isn't asynchronous - it blocks the whole process until the callback events. Ouch. If I can't figure this out I'm never gonna touch MSVC again!!! Just kidding.
|
|
|
|
|
I fear I was too quick to claim success.
Callbacks are indeed supported, but apparently MS never got around to making CInternetSession asynch. I suppose the only way to do asynch downloads (using CInternetSession ) is by using threads. But this CP article[^] may shed more light than I was able to provide.
Good luck!
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
That's probably the easiest way in the end. Thanks for all the help Ravi!
|
|
|
|
|
I need to encode a .exe file in order to put its content into some XML's CDATA. Is there any code here on CP handling such task?
rechi
|
|
|
|
|
If you're not searching for any particular encoding mechanism, one of the simplest is to substitute every byte by its representantion in hexadecimal. Doing such a coder/encoder is trivial.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
i have made a help file by using help tool provided by microsoft visual tools.
now i want to include that in my project . please tellme how to include those files in the project,
thanks
looking forward from all the gurus of code
|
|
|
|
|
You'll find an abundance of information here[^].
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I have an OCX that I wrote containing two controls: a serial port enumerator (gives a list of the available serial ports on a system), and a serial port control (does the communications, event firing etc). The enumerator doesn't have any properties (just 1 method that returns a SAFEARRAY of BSTRs with port names). The serial port control has the usual serial port properties (baud rate, parity, handshaking, data bits, stop bits, and which events the user wants notification of). In the InitDialog function of the Serial port's property page, I wanted to use the Enumerator to fill in a combo box with the port names. However, when I try this, it gives an exception and crashes whatever container it is in. Here is how I am trying to create the enumerator control:
<br />
BOOL CSerialPortPropPage::OnInitDialog() <br />
{<br />
COlePropertyPage::OnInitDialog();<br />
CWnd wndEnum;<br />
CRect rc;<br />
<br />
rc.SetRect(0, 0, 0, 0);<br />
if (FALSE == wndEnum.CreateControl(_T("SERIALPORT.SerialEnumeratorCtrl.1"), NULL, 0, rc, this, 5000))<br />
AfxMessageBox("Enumerator Creation failed!");<br />
else<br />
AfxMessageBox("Enumerator Creation Passed!");<br />
<br />
return FALSE;
Is there something I am doing wrong (I've been looking at it way too long . . . everything looks okay to me, but it still isn't working).
If this isn't correct, does anyone have a better way of accomplishing this?
Thanks
Zac Howland
"If I create everything new, why would I want to delete anything?"
|
|
|
|
|
Did you call AfxEnableControlContainer() ?
As my daughter would say, "... Whatever!"
|
|
|
|
|
Yes, I called that in the module's InitInstance. Here is the code that throws the assertion in the test container:
<br />
BOOL CWnd::Attach(HWND hWndNew)<br />
{<br />
ASSERT(m_hWnd == NULL);
ASSERT(FromHandlePermanent(hWndNew) == NULL);<br />
<br />
if (hWndNew == NULL)<br />
return FALSE;<br />
<br />
CHandleMap* pMap = afxMapHWND(TRUE);
ASSERT(pMap != NULL);<br />
<br />
pMap->SetPermanent(m_hWnd = hWndNew, this);<br />
<br />
#ifndef _AFX_NO_OCC_SUPPORT<br />
AttachControlSite(pMap);<br />
#endif<br />
<br />
return TRUE;<br />
}<br />
I am not sure how it already has a Permanent handle since I just created the object on the stack. Any thoughts?
Thanks again
Zac
"If I create everything new, why would I want to delete anything?"
|
|
|
|
|
Hello,
What's the most expedient way to simply paint a formatted text paragraph (CString) on to a CView inherited window? I'm running in to a morass of non-wrapping text positioning issues... I just want a self wrapping rectangle or, perhaps a text painter that recognizes the \n in the string.
Thanks!
JennyP
|
|
|
|