Please help, very basic, but confuse now....

Started by fygarone, November 17, 2011, 08:15:44 PM

Previous topic - Next topic

fygarone


Please help me, I just start with this IDE again after a while now and I found video tutorial from web to build button with control.
So here is what I have stuck into, very basics:

I download easycode 1.06.0.0011 for MASM32 (V10), so I also have MASM 10 installed. So very basic I try to change button color when instructed?

My code is:
---------------------------
Window1Procedure Proc Private hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
   .If uMsg == WM_CREATE

      Return TRUE
   .ElseIf uMsg == WM_CLOSE
      Invoke IsModal, hWnd
      .If Eax
         Invoke EndModal, hWnd, IDCANCEL
         Return TRUE
      .EndIf
   .EndIf
   Return FALSE
Window1Procedure EndP

Window1Button1 Proc Private hWnd:HWND, uMsg:ULONG, wParam:WPARAM, lParam:LPARAM
   .If uMsg == WM_LBUTTONDOWN
      Invoke SetBackColor, hWnd, Red
      .EndIf
   Return FALSE
Window1Button1 EndP
-------------------------------------

Still cant get this one work. BUT what makes this, (I mean me) more confuse is that with my older version 1.01.00... This really work?

Am I missing something with my new set? I also found older version 1.01... for easycode, but still cant get it work. Is it because I just think my old machine has MASM32 V.8.

-->
What is Win7 support for applications build by easycode anyway???


~Super Thanks for your help...

Ramon Sala

Hi fygarone,

For a button to be able to change its back color it must be an 'OwnerDraw' button, so please make sure the OwnerDraw property for Button1 is set to TRUE. Also, if you are using a manifest (Manifest.xml file in Miscellaneous node of the Project Explorer), remove it. A manifest tells Windows XP/Vista/7 to use the new Common Controls 6.0. Those controls have its own look and their back color cannot be changed. To remove the manifest, go to Project properties and uncheck the Manifest.xml file option.

After setting the OwnerDraw propety to TRUE for Button1 and removing the manifest (if any), rebuild the project and everything will work fine.

Regards.
Greetings from Catalonia

Ramon Sala

Oh, by the way! You should use MASM32 v10 with Easy Code 1.06.0001 and later versions. Please download it and install it in order to avoid further problems.

Thanks for using Easy Code!
Greetings from Catalonia

fygarone

SUPER, it works like a charm, thanks.

I have couple of different installation sets I have made of earlier .exe files (InstallRite silent applications) and couple of registry entry. Is there a way to add those in my project and launch them with button press? And I also want my Flash animation to play in my project as welcome screen. Is there any easy way to add those? SWF is no problem cause it can be converted into .exe projector also and no actionscript on it, only animation. Adding it into my welcome screen is, I think would be way down cool.....

fygarone


I found RCdata example and if I try to do anything change for it load more files or anything, I got: RCData.RES fatal error LNK1123: failure during conversion to COFF invalid, or corrupt?

My resources are in RES folder of my project.


Ramon Sala

Hi,

I don' know the InstallRite application, but you can load any type of file in the resources with the RT_FILEDATA keyword (Easy Code  defined). See the 'Resource Editor' in the Easy Code help file.

About the RCdata example firing errors, may I see the code?

Ramon
Greetings from Catalonia

fygarone

I finally found my error, well there was actually no any. Only reason was my help file open corrupted in background and some how stuck. I was unable to delete folder so I realize it is the reason.
Reboot my PC and my RC example works fine again with modifications I have made.

May I see any example on how to fire up .exe file from BN_CLICKED. So I can load my installer inside my project and launch it with button press. Because my TXT example works, but now it try to load my executable binary into that ext box, funny.. :D

Thanks for you support....

Ramon Sala

Hi,

I attach a simple EC project on how to run an executable file by clicking a button.

Regards,

Ramon
Greetings from Catalonia

fygarone


Thanks, this is great!
:)

.. How do I load it inside of my program, to launch it without a link. I try to add exe in my resource but something is missing while trying to launch it? (again) :(



Ramon Sala

#9
Hi fygarone,

I attach an EC project demonstrating how to include an executable (or any other type) file in the resources of an application. The included file is Drives.exe, an EC example project, and it is included as a resource in the Raw Data with the IDR_DRIVES_EXE IDentifier.

In the main window there are two buttons. The first one loads the resource into memory and writes it to the disc with its original name, Drives.exe. Then, with the second button you can run the executable file. If you like, you can also do all the work with just one button.

Regards,

Ramon
Greetings from Catalonia

fygarone

Huh, this is cool. Exactly what I was looking for. :D SUPER & Thnx..

Is it always need to be export from the original program file to be able to run it, (LOAD PROGRAM) in first run? ::)

Ramon Sala

As far as I know, the answer is yes. You first have to extract it from resources in order to create the file.

Greetings from Catalonia