5 Replies - 782 Views - Last Post: 18 November 2008 - 07:27 AM Rate Topic: -----

#1 sajmir   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 17-November 08

This code generate an error.

Posted 17 November 2008 - 02:51 PM

When i compile this code in borland compilator it generate me an error. I have copied it from a book.
Where is the error?
#include <windows.h>
int_stdcall WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR IpszCmdLine,int nCmdShow)
{
HWND h;

h=CreateWindow("BUTTON","Hit Me",Ws_OVERLAPPEDWINDOW,10,10,150,100,0,0,i,0);
ShowWindow(h,nCmdShow);
MessageBox(0,"Hi","Waiting",MB_OK);
return 0;
}


Thank you.

This post has been edited by Jayman: 17 November 2008 - 04:41 PM


Is This A Good Question/Topic? 0
  • +

Replies To: This code generate an error.

#2 Martyr2   User is offline

  • Programming Theoretician
  • member icon

Reputation: 5612
  • View blog
  • Posts: 14,686
  • Joined: 18-April 07

Re: This code generate an error.

Posted 17 November 2008 - 03:10 PM

Well first of all make sure there is a space between "int" and "_stdcall". Second, without knowing what error you are getting, it is hard to say what the problem is. Can you show us the error message you are getting?

Thanks. :)
Was This Post Helpful? 0
  • +
  • -

#3 sajmir   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 17-November 08

Re: This code generate an error.

Posted 18 November 2008 - 06:14 AM

Thnk you for replay. When i set a space betwen "int" and "_stdcall" i get 2 errors so i wrote it in this form "int_stdall"
The message is in the attach fie.

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#4 Amadeus   User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 253
  • View blog
  • Posts: 13,507
  • Joined: 12-July 02

Re: This code generate an error.

Posted 18 November 2008 - 06:30 AM

Can you put the space back and post both errors?
Was This Post Helpful? 0
  • +
  • -

#5 sajmir   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 17-November 08

Re: This code generate an error.

Posted 18 November 2008 - 06:48 AM

here is.

Attached image(s)

  • Attached Image

Was This Post Helpful? 0
  • +
  • -

#6 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6260
  • View blog
  • Posts: 24,030
  • Joined: 23-August 08

Re: This code generate an error.

Posted 18 November 2008 - 07:27 AM

Nice sig :rolleyes:

WS_OVERLAPPEDWINDOW

Like the message says, you never defined i before you used it. How about adding int i; before you use it?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1