Skip to main content
gamedev.net
🔒 Locked

callback function

Started by braves 2 replies 550+ views
Original Post
braves
braves
Hello everyone. I have a question about callback funtions. I a program and one of the api's i'm using is a api for a cdr which one of the calls ask for a callback funtion to let you know when its completed writing to the cd and error checking and stuff like that...I done this call Results = start_pt(NULL, (FARPROC)cdCallback, IOFFile, POFFile, NULL, NULL, "d:\\cdtemp", "d:\\cdtemp", ON); for some reason everything works correctly except my callback funtion never gets called. Can someone tell me what i'm doing wrong in that call for it not to call my callback function? Aslo if it helps any its a 32bit console app and the call back function I just have this in it void CALLBACK cdCallback(char *order_id, int condition, char state, char *status) { printf("Inside call back function\n"); } Thanks Braves Edited by - braves on 9/24/00 4:02:11 PM
Stoffel
Stoffel
There must be a function to register your callback with the library? Are you doing so? If you are, and it accepts your callback tag (i.e. no compile errors so you have your callback defined correctly), then I''d say there''s something else in the library you need to do (a separate "enable callback" function?), or the library''s broken.
braves
braves
Stoffel I am not sure what you mean by "register your callback with the library" this start_pt is the only api call the ask for the callback function. What do you mean by "separate "enable callback" function" and what is a broken library and how can you fix it? Thanks for your help.

Stoffel
Stoffel
if start_pr is the only function that asks for a callback, then it''s probably the function that''s used to register it. You''d have to look around the library and see if there''s not some function you''re supposed to call to enable the library to call your callback function.

So either:
1) There''s some other function in the API you need to call, i.e. some option to set, so that your callback will be called, or
2) The library doesn''t work correctly.

As for how to fix a broken library--if you have to source code, you can try to do it yourself. Otherwise, you''re up the creek.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.