Gamestudio Links
Zorro Links
Newest Posts
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
0 registered members (), 715 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 32 1 2 3 4 5 6 31 32
Re: C# wrapper - RELEASE [Re: Stromausfall] #278061
07/11/09 23:30
07/11/09 23:30
Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
pararealist Offline
Senior Member
pararealist  Offline
Senior Member

Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
@Stromausfal

Hi, i am looking for the acknex var texname.

a7.EngVar.hit. has no texname ?
or else how to find/use it ?

thanks.

MOD: delete this


Last edited by pararealist; 07/14/09 00:11.

A8.3x Commercial, AcknexWrapper and VS 2010 Express
○pararealist now.
Re: C# wrapper - RELEASE [Re: Stromausfall] #278456
07/14/09 00:10
07/14/09 00:10
Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
pararealist Offline
Senior Member
pararealist  Offline
Senior Member

Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
@Stromausfal

Hi, i am looking for the var texname.

a7.EngVar.hit. has no texname ?
or else how to find/use it ?

thanks.

(Sorry for double post)


A8.3x Commercial, AcknexWrapper and VS 2010 Express
○pararealist now.
Re: C# wrapper - RELEASE [Re: pararealist] #278511
07/14/09 09:40
07/14/09 09:40
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
Hi ! currrently hit is only a IntPtr that first needs to be cast to an EngObj.Contact (maybe i'm able to change this for the next release^^)!
here's an example :

String texname = ((a7.EngObj.CONTACT)a7.EngVar.hit).texname;

-> this should work!

cheers,
Matthias

Last edited by Stromausfall; 07/14/09 09:41.

get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
Re: C# wrapper - RELEASE [Re: Stromausfall] #278527
07/14/09 10:49
07/14/09 10:49
Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
pararealist Offline
Senior Member
pararealist  Offline
Senior Member

Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
Thanks, will try this later.

Good work you've done so far.
Looking forward to next release.


A8.3x Commercial, AcknexWrapper and VS 2010 Express
○pararealist now.
Re: C# wrapper - RELEASE [Re: Stromausfall] #279289
07/17/09 08:18
07/17/09 08:18
Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
pararealist Offline
Senior Member
pararealist  Offline
Senior Member

Joined: Dec 2006
Posts: 434
UK,Terra, SolarSystem, Milky W...
While playing with a7Wrapper:

If you use this loop

Code:
while (a7.EngFun.engine_frame() != 0) 
{ 
	UpdateAcknex(); // update your acknex stuff here
	Application.DoEvents(); //Add this here 
}




//set your acknex window to size

Code:
//get the x/y pos 
int left = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Left;
int top = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Top + 
                                                       Program.gamePlayForm.Height;
//get the w/h
int right = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Right;
int bottom = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Bottom - top;

//place the position (left,top)/ (right/bottom) in vectors 
a7.Vector vWinPos = new a7.Vector((a7.Var)left, (a7.Var)top, (a7.Var)0);
a7.Vector vWinSize = new a7.Vector((a7.Var)right, (a7.Var)bottom, (a7.Var)0);

//set title
String winTitle = "Engine: ";


//place the window at position (left,top)
a7.EngFun.video_window(vWinPos, vWinSize, (a7.Var)2, winTitle);



//and dont forget to close acknex engine in your form exit

Code:
//QUIT
private void quitToolStripMenuItem_Click1(object sender, EventArgs e)
{
    //close engine
    if(a7.EngFun.engine_frame() != 0)
         a7.EngFun.engine_close();
    //and exit
    Application.Exit();
}



Then you can have forms as well as the acknex window working together like Gimp windows does.



//
forgot this:
Also use this

Code:
while(1)
{
      ... other stuff

   /// this is equivalent to wait(1)
   a7.EngFun.engine_frame(); break;
}



Last edited by pararealist; 07/17/09 09:54.

A8.3x Commercial, AcknexWrapper and VS 2010 Express
○pararealist now.
Re: C# wrapper - RELEASE [Re: pararealist] #279301
07/17/09 08:48
07/17/09 08:48
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
Thank you for sharing this code with us !!
That's a great contribution !!


get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
Re: C# wrapper - RELEASE [Re: Stromausfall] #280183
07/21/09 11:28
07/21/09 11:28
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Is a7.EngFun.engine_frame() analagous to wait(1)?

I'm experimenting with window handles and the Win32 API and i'm using vars such as a7.EngVar.hWnd and a7.EngVar.hWndTarget. The manual states that these variables only become available after 1 frame, so wait(1) is needed.

I'm using the API call GetWindowText to test if I can get the text of the engine Hwnd...

Code:
[DllImport("user32.dll", EntryPoint = "GetWindowText", CharSet = CharSet.Ansi)]
        public static extern bool GetWindowText(IntPtr hWnd, [OutAttribute()] StringBuilder strNewWindowName,
            Int32 maxCharCount);

        static void Main(string[] args)
        {
            a7.EngFun.engine_open(null);
            a7.EngFun.engine_frame(); // acts as wait(1) ???

            StringBuilder sb = new StringBuilder(256);
            GetWindowText(a7.EngVar.hWnd, sb, sb.Capacity);
            MessageBox.Show(sb.ToString());

            while (a7.EngFun.engine_frame() != 0)
            {

            }
        }
    }



...But every time the string buffer is empty. I've tested this code on other applications like notepad.exe, by getting it's handle, and it returns the name in the title bar no problems.

So is there a problem with my code? Or are the engine vars not functioning properly?

Re: C# wrapper - RELEASE [Re: DJBMASTER] #280200
07/21/09 12:58
07/21/09 12:58
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
Yes in this case a engine_frame() call should be equivalent to wait(1). I just tried to use hwnd and you are right, there seems to be a problem, because hwnd seems to be always 0. I'll look into that right now ^^


get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
Re: C# wrapper - RELEASE [Re: Stromausfall] #280216
07/21/09 14:04
07/21/09 14:04
Joined: Dec 2002
Posts: 616
Austria
Stromausfall Offline OP
User
Stromausfall  Offline OP
User

Joined: Dec 2002
Posts: 616
Austria
@DJBMASTER : sent you a pm with a test version


get the C# wrapper:
for A7.85.4 and A8.30.4, Version 2.3.9
at http://acknexwrapper2.matthias-auer.net/ or visit the thread
Re: C# wrapper - RELEASE [Re: Stromausfall] #280759
07/24/09 06:48
07/24/09 06:48
Joined: Nov 2007
Posts: 1,143
United Kingdom
DJBMASTER Offline
Serious User
DJBMASTER  Offline
Serious User

Joined: Nov 2007
Posts: 1,143
United Kingdom
Hi, Ok i was wondering if the form rendering issue was due to the difference of a C# form. I decided to investigate by not using a C# form and creating a form programmatically from WinAPI.

This is exactly the same process that C++ uses, and I can get the engine to target render in c++ no problems.

I used exactly the same methods/properties I used in C++ and the window appears no problem but still the engine wont render into it.

From this i can only conclude that it is the fault of the wrapper. It might not be marshalling the type correctly or something.

I know you have no experience with C# forms Stromausfall, but if you use WinAPI you will see the engine still wont render.

Thanks.

Last edited by DJBMASTER; 07/24/09 06:48.
Page 4 of 32 1 2 3 4 5 6 31 32

Moderated by  TWO 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1