Author Topic: Windows Projects  (Read 16256 times)

Manos

  • Moderator
  • Member
  • *****
  • Posts: 50
Windows Projects
« on: February 09, 2019, 06:22:42 AM »
I upload three simple projects.
To help you, put the files of each project in the bin folder,
as I describe in my post :Using CoderStudio Tools
After build each project, delete its files from the bin folder
and put the files of the other project.

Manos.
« Last Edit: February 09, 2019, 08:20:53 PM by Manos »

Vortex

  • Member
  • *****
  • Posts: 2768
Re: Windows Projects
« Reply #1 on: February 09, 2019, 09:07:35 PM »
Thanks for the examples. Here is how to build the dialog box example with a batch file :

Code: [Select]
\pcc32\bin\pcc32.exe /I\pcc32\include /c Frame.c
\pcc32\bin\rc32.exe /I\pcc32\include Dialog.rc
\pcc32\bin\link32 /LIBPATH:\pcc32\lib /SUBSYSTEM:WINDOWS Frame.obj Dialog.res kernel32.lib user32.lib shell32.lib gdi32.lib comctl32.lib msvcrt.lib

Vortex

  • Member
  • *****
  • Posts: 2768
Re: Windows Projects
« Reply #2 on: February 09, 2019, 10:33:40 PM »
Here is a classical window example.

Vortex

  • Member
  • *****
  • Posts: 2768
Re: Windows Projects
« Reply #3 on: February 12, 2019, 06:26:24 AM »
Bitmap from file example.

Manos

  • Moderator
  • Member
  • *****
  • Posts: 50
Re: Windows Projects
« Reply #4 on: February 12, 2019, 07:35:56 AM »
Very good example Vortex.

Note:
With CoderStudio IDE you can mix assembly and C modules.
Soon I 'll upload your project using CoderStudio IDE.

Manos.

Manos

  • Moderator
  • Member
  • *****
  • Posts: 50
Re: Windows Projects
« Reply #5 on: February 13, 2019, 08:33:58 PM »
Open with CoderStudio IDE the BmpFromFile.sdp file
and build the project.

Manos.

Vortex

  • Member
  • *****
  • Posts: 2768
Re: Windows Projects
« Reply #6 on: February 14, 2019, 06:44:59 AM »
Hi Manos,

Thanks, it works as expected.

TimoVJL

  • Member
  • *****
  • Posts: 1296
Re: Windows Projects
« Reply #7 on: February 14, 2019, 08:28:04 AM »
When we see that the pcc32 is able to compile UASM from source  ?
Now, missing headers, hanging,...
May the source be with you

Manos

  • Moderator
  • Member
  • *****
  • Posts: 50
Re: Windows Projects
« Reply #8 on: February 14, 2019, 08:45:06 AM »
When we see that the pcc32 is able to compile UASM from source  ?
Now, missing headers, hanging,...

Could you send me the 32 bit source to try it ?

Manos.

TimoVJL

  • Member
  • *****
  • Posts: 1296
Re: Windows Projects
« Reply #9 on: February 14, 2019, 08:48:04 AM »
May the source be with you

Vortex

  • Member
  • *****
  • Posts: 2768
Re: Windows Projects
« Reply #10 on: February 16, 2019, 06:29:19 AM »
An example to save the icon of an executable :
Code: [Select]
#include <windows.h>
#include <olectl.h>

const IID __cdecl IID__IPicture =
    { 0x7BF80980, 0xBF32, 0x101A, { 0x8B, 0xBB, 0x00, 0xAA, 0x00, 0x30, 0x0C, 0xAB } };

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    LPSTR lpCmdLine, int nCmdShow)
{
PICTDESC pd;
HICON hIcon;
HMODULE hModule;
IPicture *pBitmap;
IStream  *pStream;
LONG pcbSize;
HGLOBAL hGlobal;
LPVOID IconAddr;
HANDLE hFile;
DWORD bWritten;

// load the test executable and the associated icon

hModule = LoadLibrary("Test.exe");
hIcon = LoadIcon(hModule,MAKEINTRESOURCE(100));

// initialize the PICTDESC structure

pd.cbSizeofstruct = sizeof(PICTDESC);
pd.picType = PICTYPE_ICON;
pd.icon.hicon = hIcon;

// create the OLE image

OleCreatePictureIndirect(&pd,&IID__IPicture,TRUE,(void **)&pBitmap);

// create the destination stream to save the icon
                                                   
CreateStreamOnHGlobal(NULL,TRUE,(LPSTREAM *)&pStream);

// save the icon to the stream
                                                   
pBitmap->lpVtbl->SaveAsFile(pBitmap,(LPSTREAM)pStream,TRUE,&pcbSize);

// get the address of the icon in memory

GetHGlobalFromStream(pStream,&hGlobal);
IconAddr = GlobalLock(hGlobal);

// write the icon to disc

hFile= CreateFile("Smiley.ico",GENERIC_WRITE,0,0,
CREATE_ALWAYS,0,0);

WriteFile(hFile,IconAddr,pcbSize,&bWritten,0);

CloseHandle(hFile);

// release the pointers

pBitmap->lpVtbl->Release(pBitmap);
pStream->lpVtbl->Release(pStream);

return 0;
}

Manos

  • Moderator
  • Member
  • *****
  • Posts: 50
Re: Windows Projects
« Reply #11 on: February 17, 2019, 10:40:06 PM »
When we see that the pcc32 is able to compile UASM from source  ?
Now, missing headers, hanging,...

Download the Additional Includes and put the new header files
in the include folder.

Manos.

TimoVJL

  • Member
  • *****
  • Posts: 1296
Re: Windows Projects
« Reply #12 on: February 17, 2019, 11:27:53 PM »
missing signal.h io.h sys/stat.h
pcc32.exe hangs in equate.c
May the source be with you

Manos

  • Moderator
  • Member
  • *****
  • Posts: 50
Re: Windows Projects
« Reply #13 on: February 18, 2019, 12:03:18 AM »
missing signal.h io.h sys/stat.h
pcc32.exe hangs in equate.c

Today I 'll upload an updated include folder.

Manos.

Manos

  • Moderator
  • Member
  • *****
  • Posts: 50
Re: Windows Projects
« Reply #14 on: February 18, 2019, 05:16:38 AM »
missing signal.h io.h sys/stat.h
pcc32.exe hangs in equate.c


The include files and the pcc32 are updated to avoid hanging.

Downlad pcc32 from: http://www.manoscoder.gr/mysite/coderstudio.htm

Manos.