Jump to content

How to test my C code using AutoIt


Recommended Posts

Link to comment
Share on other sites

Thanks Beege,

Its not fulfilling my hungryness.

I will give my requirement in some more detail:

1. My code has to display "CD loading" when CD got inserted.

2. Now my logic is ready for that

3. But, now there is no hardware to insert a CD

4. I will write some stub code to give a CD insert event to my logic which will display "CD Loading"

5. My requiremnt is that, am I able to write a GUI button such a way that whenever I click on that button, it has to call the stub function

which will send a CD insert event to my Logic.

6. How Can I achieve this above point 5.

Please help me.

Link to comment
Share on other sites

  • Moderators

Hi, Prakashteki. From your requirements list you need to:

1. Build your GUI (See GuiCreate example in the help file)

2. Add a button (See _GUICtrlButton_Create in the help file)

3. Add code to have that button call your CD insert logic (try _GUICtrlButton_GetState in the help file)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • 2 weeks later...

Hey, These functions GuiCreate, _GUICtrlButton_Create.... are for creating GUI. That is fine.

Now when I want to call my C language function definition. It is throughing error.

When I click that button, I am simply calling a function which is in another file (say abc.c).

May I need to compile with different compiler or need to change anything.

Please help me.

Edited by prakashteki
Link to comment
Share on other sites

Now when I want to call my C language function definition. It is throughing error.

When I click that button, I am simply calling a function which is in another file (say abc.c).

I'm hoping I'm reading this wrong. AutoIt can only execute code written with the AutoIt language. Your not actually trying to call a function written in c with AutoIt are you?

Also Its hard to help you find whats wrong with your script without actually seeing your script. Post your code and we will be able to help you much better :)

Link to comment
Share on other sites

  • Moderators

Prakashteki, can you please confirm that this is what you have?

1. A compiled C - language executable.

2. An AutoIt script that, when you choose the CD insert event, calls to that EXTERNAL C-language executable

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Sorry if its actual c source code that your trying to call thats just not going to work ( for pretty obvious reasons IMOP). The only possible solution that I have ever seen on these forums is the one I put in post 2.

Link to comment
Share on other sites

  • Moderators

I agree, Beege. My original (probably mistaken) assumption was he was calling to some external app...

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • 3 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...