Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / houston ... i have a VC problem ...

Author
Message
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 5th Aug 2003 19:27
oki, i've done something to VC... i must've and i'm not sure what the hell i've done.

because this code





although SHOULD work... comes back with this error ->


i've done something to it, i must've - but what exactly i've done i'm not entirely sure
http://ravenstudios.puffinteractive.com/personal/rslogo.gif[/img]
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 5th Aug 2003 19:39 Edited at: 5th Aug 2003 19:43
Try :



You never know - may work...
One other thing - you have a ; at the end of the #define line... Naughty! (I didn't see that until after I rearranged your EXTERNCOM lines)
One other thing - your logo isn't being displyed...


Logo design by Indi
Its better than a poke in the eye...
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 5th Aug 2003 21:05
ya know perhaps i should get more rest... can't believe i didn't see that, explains quite a bit now.
where's that yahoo! doh! smilie when you need it
was wondering why my old DLL was working and the new one wasn't - lol cheers

(ps i know about the logo thing, it seems to cut in/out whenever i post links or code - think its a forum problem)

MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 5th Aug 2003 21:25
Well, if you want me to reliably host it for you - just ask


Logo design by Indi
Its better than a poke in the eye...
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 5th Aug 2003 21:37
yeah thanks...
i've got up an old problem again...

OpenEA.obj : error LNK2001: unresolved external symbol __imp__alGetError

i've tried everything i know to setup the importing and loading, and nothing seems to work.
its weird & frustrating, cause i've tried so many ways ... and i have a feeling that it was only working when i was creating an exe.
which if the case then i'm not sure what to do.

this is the last time i turn of source control because i got this working before but now - i can't figure how i did it.
you want maybe i could send you the APi i'm using see if you can import the functions ... cause i'll be damn'd if i know how.
i really want this too cause it pretty cool

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 5th Aug 2003 21:43
Try doing a rebuild instead of a build. Sometimes the linker gets a bit confused.

Also, make sure you are using the release version of the .lib in release mode, and the debug version in debug mode.
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 5th Aug 2003 21:55 Edited at: 5th Aug 2003 21:57
there seem to only be the release libs, linked right ... dunno what could be up

tried release mode, debug mode, single-threaded, multi-threadead
importing from the lib/dll
prototyping

dunno i'm kinda outta ideas

[edit-]
something that puzzles me is that after including the headers the functions don't appear to be prototyped and showing up when i type them in as they normally would

MushroomHead
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 5th Aug 2003 22:18
Project/Settings ... select setting for "All Configurations" from drop down list on left .. click Link tab and select Input category and add the .lib file you are linking to in object/library modules ...
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 5th Aug 2003 22:24
hey cool that worked
cheers ... i thought it was already linking them, guess not though.

lets hope i can get this working fully

MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 5th Aug 2003 23:28
Have a rest first though...


Logo design by Indi
Its better than a poke in the eye...
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 6th Aug 2003 00:45
probably a good idea ... just finished my player model, just waiting for my woman to call me back - think i'll lay on the beach and grab myself a cold one and have a nap

Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 6th Aug 2003 18:44
quick q about the classes...
how exactly do you export a namespace function?

would it be
EXPORTCOM void EnvAudio::Init( void ); //?
or is it done within the class itself?

and if you do export like that is the string table for DBP recognise it as

Initilise OpenAE%0%EnvAudio::Init
or just
Initilise OpenAE%0%Init

MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 6th Aug 2003 19:52
Pass - never, EVER used namespaces - I tend to use only a limited sub-section of C++ - much easier to debug that way.

I think Ian would be able to help there...


Logo design by Indi
Its better than a poke in the eye...
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Aug 2003 20:39
If you are trying to export a class member function for DBPro to use, don't bother because they can only be called by providing the 'this' pointer of the object as their first argument (all C++ compilers pretty much do it in this way).

However, if you are using namespaces, with code like this:



You'll get this:

Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 6th Aug 2003 21:24
hmm... so i can't undecorate them?
interesting - whenever i've done this before i've just used multithreading with headers ... thats what i'm doing with PureBasics DLL but for DBP i can't do that.

so something like



something like that right? or does it have to be in a seperate part to the class in something called namespace.
which you declare everything like



IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Aug 2003 21:54
I think that you're getting namespaces and classes mixed up. You are also trying to allow access to objects from DBPro, and that won't work.

For DBPro, unless you are managing many versions of the same object, I'd give objects a miss ... and namespaces too, unless you really need them.
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 6th Aug 2003 22:02
well using a class would make this ALOT simpler to setup.
because i can either make a single class for an object - else can several functions which need to work with each other.

i mean as i was aware '::' was namespacing ... which is how you access the functionality within a class.
suppose i could go back to setting up the class and objects seperate and using standard functions to access the data needed.



IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 6th Aug 2003 22:21
Nope. '::' is the scoping operator.

You can always use something like this:



Then when you need to access code within the namespace, you'd do it like this 'MyStuff::Initialise', 'MyStuff::Shutdown()', 'MyStuff:oStuff()', 'MyStuff::Buffer[0]'.

For code within the namespace, you don't need to specify the 'MyStuff::' bit, so accessing Buffer is simply 'Buffer[0]' and accessing the Initialise function is 'Initialise()'.
Eddie Gordo
21
Years of Service
User Offline
Joined: 14th Jan 2003
Location: Ohio - USA
Posted: 6th Aug 2003 22:23
I once tried to make a cool program in VC++...heres the code i came up with...



Man thats some godly code...

Visual Programming Studio ORANGE
Replacement IDE for Dark Basic Professional...
(Will Be Availeable When This is Removed)
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 6th Aug 2003 22:55
hmm i think i need to find my msdn CD again... see what it says about the scope operator.
gotta say i think i'm completely lost now to what namespacing is, so probably best to leave it be

Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 9th Aug 2003 08:20
main.cpp


main.h


this should work... it compiles fine, i can't figure out why it doesn't - but when i run it, dbp just quits on me ... earlier was getting errors but not now just nothing

begining to drive me nuts, especially as the msdn help is close to useless on using external DLLs and applying thier functions.
i'd use Ian's interface but i get errors all over the shop whenever i do ... my VC just doesn't like it. (not even the example compiled)

i'm sure one of you guys knows howto do this - i'm gonna grab an hr or so's kip as i'm cream cracked
this should've been simple

MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 9th Aug 2003 09:20
Interesting, I got an error. Maybe my dark basic pro is screwed up or something.

"Access Violation at address 574F444E. Read of Address 574F444E."

I doubt that has anything to do with your problem though.

It's 1:00 A.M here, so I think I better grab myself an ice-cream snack and go to sleep.(or stay up and try to figure out what I'm doing trying to fix this code. )

@Raven

Does the code work under debug mode?

Hmmmm, I'll get back to you tomorrow. Unless someone else fixes the code. Give me 2 days(starting tomorrow ), and I'll get it working.




Website 50% done (May be out by mid-end August)
MrTAToad
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United Kingdom
Posted: 9th Aug 2003 13:21 Edited at: 9th Aug 2003 13:22
Shouldn't makeCude be called along the lines of :

(MakeCube)( iObject, fSize ) ?

And finally :

It is not safe to call LoadLibrary from DllMain. For more information, see the Remarks section in DllMain.

I presume you have MSDN ? If so, have a look under DLLMain.


Logo design by Indi
Its better than a poke in the eye...
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 9th Aug 2003 16:59
yeah, i already have have a DllMain though and i think it'd collide using one whilst another has been prototyped.
The prototype fo the funciont is the
typedef [return]([ifreturn CALLBACK* name]else[*name])([params]);

what confuses me is... is that function in C++ actually there for use now? because i know that i can't get it to work externally - but really that matters only a little.

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Aug 2003 18:58
Why are you getting the DLL handle that anyway? The handle for the Basic3D DLL is in the globstruct.

Also, your typedef is wrong, but not by a lot. You need this instead:



Alternatively, why not use my library? It does all this for you, and even deals with DLLs that aren't in the globstruct in a safe way.
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 10th Aug 2003 02:31
cool thanks Ian...
i'm trying to handle the DLL like that cause i've never setup external DLLs functions before - looked on MSDN and that appeared to be what the help was showing.
also said why i'm not using your library - but i'll repeat

a) it doesn't compile for me, it throws up a tonne of errors i've never seen before
b) the DLLs are for DBP <4.1 & 5.x< so i need the different global structures (which thanks to Lee i have)

i just need the interaction internal from selective DLLs ... however there is a problem i've noticed that if they don't include any of the functions from the DLLs used.
it isn't going to compile the needed libraries.

so any clues on how i can do that?

IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Aug 2003 03:30
If you're using VC++6, then you can only (currently) use my library in release mode ... it's something I'll have to work on. As I'm planning on releasing a MINGW version of the library, I might as well release a VC++6 version with debug libraries too.

The Update 5 library will be released when the Update is officially released.

And your last point ... is dealt with in the library documentation
It's not a great way of dealing with it, but it's the best I have ATM. Here's the relevant piece of text:

Quote: "You must ensure that the parts of DarkBASIC Professional that your DLL uses are built into the application at compile-time.

Sometimes this is fairly easy to arrange. For example if you write code that pastes an image to a bitmap (for example in a tiling library) then the image DLL will be included by DarkBASIC Professional automatically because the user will use the load image or get image commands to create the required images.

At other times, this is not guaranteed to happen. For these cases you instruct the user to ensure that this happens."
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 10th Aug 2003 04:59
no i know about the release mode problem... the one i had was very different - i'll compile the demo and post the results below...



Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 10th Aug 2003 05:06
i know that its pretty guarenteed that the user will use something in the Basic3D ... but not always the Memblock one.
ya know alot of these problems could be avoided if DBS actually release a proper SDK sometime.

guess i'll just have to add into the include files.

Login to post a reply

Server time is: 2024-09-20 08:20:41
Your offset time is: 2024-09-20 08:20:41