Dennis
-Interested User-
Posts: 19
Joined: Oct 8, 2004
|
Posted: Oct 8, 2004 10:30 AM
Msg. 1 of 4
I cannot get the while(!goodToGo) loop to release in the VC++ console_stream example. Early testing indicates that the callback, which is intended to set goodToGo, never occurs. Has anyone else experienced this problem?
Test program (C++) and output follows: ----------------------------------------
// callback_test.cpp : Defines the entry point for the console application. //
#include "stdafx.h"
bool goodToGo = false;
void __stdcall callback(int x, int y) // Receives information from iqfeed. { cout << "callback from IQFeed...\n"; // Test Trace goodToGo = (x==0 && y==0);
if (x && y) { cout << "IQFeed delivered close message\n" << endl; RemoveClientApp(NULL); exit(0); } }
int main(int argc, char* argv[]) { cout << "main..\n"; // Test Trace
SetCallbackFunction(callback); // set the callback function to get info from IQFeed cout << "callback function set..\n"; // Test Trace
RegisterClientApp(NULL, "IQFEED_DEMO", "1.0", "1.0"); // start iq feed cout << "registered client...\n"; // Test Trace
while (!goodToGo) { // wait for the callback cout << "waiting for callback...\n"; // Test Trace Sleep(100); }
cout << "goodToGo...\n"; // Test Trace return 0; } -----------------------------------------------------------------------------------------
Console Output: --------------- main.. callback function set.. registered client... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... (ad infinitum) -------------------------------------------------------------------------------------------
Using IQFeed Files: ------------------- IQ32.h 5 KB 1/29/2003 1:55PM IQ32.lib 8 KB 3/15/2004 11:00AM IQ32.dll 96KB 7/26/2004 5:23PM
Note: I have compiled the console_stream example and the test program in both the Visual C++ and Visual .NET (C++) environments with the same result.
|
Dennis
-Interested User-
Posts: 19
Joined: Oct 8, 2004
|
Posted: Oct 8, 2004 12:14 PM
Msg. 2 of 4
Since my original posting, I reconfigured my environment and I now have a working instance of my test example (output below). I will try to isolate the particular change or changes that made the difference, and I will post under this thread.
Output from test program (after changes): ------------------------------------------------- main.. callback function set.. registered client... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... waiting for callback... callback from IQFeed... goodToGo... Press any key to continue
|
Dennis
-Interested User-
Posts: 19
Joined: Oct 8, 2004
|
Posted: Oct 9, 2004 01:36 PM
Msg. 3 of 4
The "No Callback" problem relates to how IQConnect.exe and IQ32.dll are accessed during runtime. It is possible to position these modules (in folders relative to your exe) in such a way as to cause the "No Callback" problem and mask an exception that IQConnect would otherwise display.
More to come...(busy weekend). Dennis
|
Dennis
-Interested User-
Posts: 19
Joined: Oct 8, 2004
|
Posted: Oct 9, 2004 03:48 PM
Msg. 4 of 4
You can recreate the "No Callback" with the following steps: 1. Remove from you PATH, the IQFeed directory (the installed location of IQConnnect.exe and IQ32.dll). 2. Copy IQ32.dll to your working directory (location of console_stream.exe or executable of above example). 3. Run console_stream.exe or executable of above example.
The "why would anyone do this" and/or "why this causes a problem" requires a lengthly post; which I will be glad to supply if someone is interested.
Otherwise, "...onward through the fog". Dennis
|