Thread

[VC++] Enum + Other things (Sdk)

[VC++] Enum + Other things // Sdk

1  |  

strike rapier

Aug 31, 2002, 4:03pm
Hi Everyone,
I was wondering if anyoen could explain to me how the heck to get VC++ 6 to display the enum of the aw.h file? Ive used #include "aw.h" and also have the header file loaded into it.

I also painstaiking spent ages creating about 40 lines of text then...

#include <iostream>
#include <iomanip>
#include "windows.h"

#define AW_STATIC
#include "aw.h"
using namespace std;

void func_aw_avatar_add(void);
void func_aw_avatar_delete(void);

int main(void)
{
long rc = 0, citnum = 0;
char ppw[15], strcitnum[15];
void* bot;
cout << "Welcome to the 'Who the hell is here' program." << endl << "By Mark Randall" << endl << endl;
rc = (aw_init(AW_BUILD));
if(rc != 0)
{
cout << "Cannot initiate API - Reason: " << rc << endl;
exit(1);
}
else
{
cout << "API initiated sucessfully with build number: " << AW_BUILD << endl;
}
rc = 0;
aw_event_set(AW_EVENT_AVATAR_ADD,func_aw_avatar_add);
aw_event_set(AW_EVENT_AVATAR_DELETE,func_aw_avatar_delete);

/*create bot instance*/
rc = aw_create(0,0,&bot);
if(rc)
{
printf("Unable to create instance (reason:%d)\n",rc);
}
else
{
printf("Successfully created instance\n");
}
return 0;
}

THIS!!! GAHHHHH!!

Linking...
aw.h : fatal error LNK1136: invalid or corrupt file
Error executing link.exe.

Could someone tell me what that means and how I can nuke the error and get on with my programming? C++ is stressfull enough even when things DO work.

- Mark

agent1

Aug 31, 2002, 4:31pm
Is aw.h in the same directory as the source files or in one of the VC++
include directories?

-Agent1

[View Quote]

strike rapier

Aug 31, 2002, 5:26pm
aw.h is in ../microsoft visual studio/vc98/include/ and the proggy folder

[View Quote]

deconstructor

Aug 31, 2002, 5:54pm
> aw.h is in ../microsoft visual studio/vc98/include/ and the proggy folder

If it is in that folder (for standard includes), the #include must be in
<>'s

#include <aw.h>

Or you could add the file to your project and do #include "aw.h" :)

Deconstructor

strike rapier

Aug 31, 2002, 10:05pm
I tried both, no joy
[View Quote]

ananas

Sep 1, 2002, 8:45am
Not a problem of the include of aw.h, as it is a link error.

I guess the problem is that the aw.h file is in the additional
libraries, where aw.lib or awstatic.lib should be instead.


The other one, display the enum, cannot be done from aw.h as
they are not much more than an array of integers (that's why
++ and -- works on enums), but the identifiers are only
processed be the compiler, they disappear later for the same
reason why you cannot display the #define identifiers but only
their values from the running program.



[View Quote] [..] C source snipped, not relevant for this error message

>
> THIS!!! GAHHHHH!!
>
> Linking...
> aw.h : fatal error LNK1136: invalid or corrupt file
> Error executing link.exe.
>
> Could someone tell me what that means and how I can nuke the error and get on with my programming? C++ is stressfull enough even when things DO work.
>
> - Mark

strike rapier

Sep 3, 2002, 3:34pm
So how does VB do it then, as its handled the same I presume?


[View Quote]

ananas

Sep 3, 2002, 4:29pm
I don't think something like an enum exists in VB, I'm not
too familiar with it though. But a control sure could have
the text representation of the error numbers as a list that
can be accessed with a method - just I'm not familiar with
the VB-SDK for AW either :-/


[View Quote]

kah

Sep 10, 2002, 4:58pm
"ananas" <vha at oct31.de> wrote in news:3D74F9D6.A0C2177F at oct31.de:

> I don't think something like an enum exists in VB, I'm not
> too familiar with it though. But a control sure could have
> the text representation of the error numbers as a list that
> can be accessed with a method - just I'm not familiar with
> the VB-SDK for AW either :-/

Enums exist in VB too.

KAH

1  |  
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn