class myClass
{
public:
myClass(){g_pDS = NULL;};
freind myClass *NewInterface(long hWindow);
protected:
IDirectSound8 *g_pDS;
//Rest of info on buffer
myClass *Next;
}
myClass *NewInterface(long hWindow)
{
myClass *NewInt;
NewInt = new myClass;
DirectSoundCreate8(NULL, &(NewInt->g_pDS), NULL); // heres the problem it wont recognize a pointer to a pointer to a member that is a pointer if you know what I mean
// rest of code to initialize the primary buffer
return NewInt;
}
[edited by - NRMStudios on January 30, 2003 6:21:15 AM]
Pointers, pointers, pointers
I'm trying to create a class so I can generate a link list of primary and secondary buffers for each window of my app but I'm having a hard time manageing all the pointers, please take a look at the code below. Any help would be great.
At first glance, that looks okay. What error are you getting?
Don''t listen to me. I''ve had too much coffee.
Don''t listen to me. I''ve had too much coffee.
You have declared a friend function to the class myClass named:
But that friend function is not the same as the function named:
Change the return type of the second function to
Update GameDev.net system time campaign:
myClass *NewInterface(long hWindow);
But that friend function is not the same as the function named:
void NewInterface(long hWindow);
Change the return type of the second function to
myClass*
instead of void
and it should work. Update GameDev.net system time campaign:
''date ddmmHHMMYYYY''
quote:Original post by dalleboy
You have declared a friend function to the class myClass named:myClass *NewInterface(long hWindow);
But that friend function is not the same as the function named:void NewInterface(long hWindow);
Change the return type of the second function tomyClass*
instead ofvoid
and it should work.
Update GameDev.net system time campaign:''date ddmmHHMMYYYY''
Sorry this was a minor over sight on my part but not the cause of the error.
quote:Original post by Sneftel
At first glance, that looks okay. What error are you getting?
<hr>Don''t listen to me. I''ve had too much coffee.
the problem is in the line:
DirectSoundCreate8(NULL, &(NewInt->g_pDS), NULL);
The error get is a linking error of some sort and when I try:
DirectSoundCreate8(NULL, NewInt->g_pDS, NULL);
I get an error something like: error arguement 2 I''''l print the exact messages when I get home.
quote:Original post by Sneftel
At first glance, that looks okay. What error are you getting?
Don''t listen to me. I''ve had too much coffee.
the problem is in the line:
DirectSoundCreate8(NULL, &(NewInt->g_pDS), NULL);
The error get is a linking error of some sort and when I try:
DirectSoundCreate8(NULL, NewInt->g_pDS, NULL);
I get an error something like: error arguement 2 I''''l print the exact messages when I get home.
quote:
the problem is in the line:
DirectSoundCreate8(NULL, &(NewInt->g_pDS), NULL);
The error get is a linking error of some sort
That is the correct way to call it. What is the linking error? Are you linking to the directx libs in your project?
Yeah I am writting it the correct way. I tried it with out all the fancy pointers and get the same linking error listed below:
[Linker error] undefined reference to `DirectSoundCreate8@12''
[Linker error] undefined reference to `DirectSoundCreate8@12''
You need to add "dinput8.lib" to your list of link libraries and make sure the DirectX SDK lib directory is in your library path.
[edited by - fizban75 on January 30, 2003 5:46:41 PM]
[edited by - fizban75 on January 30, 2003 5:46:41 PM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement