cppman Posted August 17, 2008 Share Posted August 17, 2008 This thread is funny. Does someone mind answering a uh... better question. Since you must use AutoItx3.dll as a recource, this means you must have this in the same directory as your compiled AutoIt C++ program? If so, is there anyway to use dll's as an internal recource?I think that may be a bit hard. Sure, having it embedded in the EXE as a resource is easy, but when it comes time to call a function, you'd have to do that manually. If I'm not mistaken (and of course, I probably am), the Windows API doesn't have any functions for getting the address of a function that has all ready been loaded into memory. So, you'll either have to find the address of the function in memory, typecast it to a typedef of a function pointer (to the function you are trying to call) and then call it, or you can setup the stack, and call it through ASM. typedef int(*LPADD)(int,int); // typedef for an add function... int main() { void* address = ...; //get the address of the function... LPADD add = (LPADD)address; int sum = add(100,200); } Or the ASM way, (something like this anyways): int main() { void* address = ...; //get address of the function... __asm { push 100 push 200 call dword ptr [address] pop pop } } Miva OS Project Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted August 17, 2008 Moderators Share Posted August 17, 2008 I think that may be a bit hard. Sure, having it embedded in the EXE as a resource is easy, but when it comes time to call a function, you'd have to do that manually. If I'm not mistaken (and of course, I probably am), the Windows API doesn't have any functions for getting the address of a function that has all ready been loaded into memory.http://www.autoitscript.com/forum/index.php?showtopic=77463 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
jvanegmond Posted August 19, 2008 Share Posted August 19, 2008 I posted before this was locked. github.com/jvanegmond Link to comment Share on other sites More sharing options...
BrettF Posted August 19, 2008 Share Posted August 19, 2008 So did I.....! Wooooooooo Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
dandymcgee Posted August 26, 2008 Share Posted August 26, 2008 (edited) Wow... uh, wow. You shouldn't blatantly disrespect Valik like you did, but rather take the time to LISTEN & COMPREHEND his 'useless comments which aren't helping me solve the ONE error I have'. That one error (as has been stated numerous times thus far) is an error that only someone who has never even glanced at a most basic C++ guide before would make. Now go stand in the corner and think about what you have done.. and bring a C++ book with you; you might actually learn something. Edited August 26, 2008 by dandymcgee - Dan [Website] Link to comment Share on other sites More sharing options...
AgentSmith15 Posted August 26, 2008 Share Posted August 26, 2008 Might I suggest if you are serious about learning C++ I would suggest the book below.C++ How to Program (6th Edition) http://www.amazon.com/Program-Harvey-Paul-.../dp/0136152503/It even covers a little over some of the changes in C++0x. [center][/center] Link to comment Share on other sites More sharing options...
dandymcgee Posted August 26, 2008 Share Posted August 26, 2008 (edited) There are plenty of resources out there for learning C++ these days, he just needs the motivation. I started off thinking similar thoughts; I'll just jump right into C++ like I did with AutoIt and figure it all out on my own. That's not possible. Not without some sort of reference or resource. Although AutoIt may have been written in C++, it is an entirely different language. Therefore, one must understand the differences before you can attempt to take advantage of the similarities. Edited August 26, 2008 by dandymcgee - Dan [Website] Link to comment Share on other sites More sharing options...
AgentSmith15 Posted August 26, 2008 Share Posted August 26, 2008 I jumped into programming trying to learn Assembly, and boy was I in a world of hurt. (Offtopic: If you want to start in Assembly check out HLA) If you really want to learn C++ first your going to have to be motivated. [center][/center] Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 27, 2008 Share Posted August 27, 2008 I learned C++ by jumping into it. Link to comment Share on other sites More sharing options...
NELyon Posted August 27, 2008 Share Posted August 27, 2008 I'm learning C++ by both jumping and referencing other sources. Boom. What now? Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 27, 2008 Share Posted August 27, 2008 No, that makes you lame for relying on learning material. Link to comment Share on other sites More sharing options...
Draygoes Posted August 27, 2008 Share Posted August 27, 2008 Lame for looking up tuts and buying books? Isnt that what you guys have been trying to tell the op to do??? Spoiler  "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist.   Link to comment Share on other sites More sharing options...
dandymcgee Posted August 27, 2008 Share Posted August 27, 2008 (edited) I learned C++ by jumping into it. Well surely anyone with the capability of simply jumping in and learning C++ without reference would have been able to figure this out: cannot convert parameter 1 from 'int' to 'const char *' .. in a matter of seconds. Edited August 27, 2008 by dandymcgee - Dan [Website] Link to comment Share on other sites More sharing options...
jvanegmond Posted August 29, 2008 Share Posted August 29, 2008 Well surely anyone with the capability of simply jumping in and learning C++ without reference would have been able to figure this out: cannot convert parameter 1 from 'int' to 'const char *' .. in a matter of seconds.I didn't read all the other posts, so I am sorry for jumping in the middle of a discussion possibly. I could figure it out if I knew another language that uses data types quite quickly. I would know I would have to convert int to a const char * or replace the function by something that accepts an const char * instead of an integer. I would then Google a solution. I would then try something with ostringstream and c_str(). So, all in all, it wouldn't be seconds, but it will not take hours either. github.com/jvanegmond Link to comment Share on other sites More sharing options...
dandymcgee Posted August 30, 2008 Share Posted August 30, 2008 (edited) @Manadar - Exactly.. you would have either already known why the error showed up, or you would have taken the initiative to look it up. The exact time it would've taken is irrelevant. Edited August 30, 2008 by dandymcgee - Dan [Website] Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 31, 2008 Share Posted August 31, 2008 Unless you're being charged for time. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now