News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

MASM 10 & colib ?

Started by BasilYercin, September 27, 2008, 10:27:32 PM

Previous topic - Next topic

BasilYercin

i dont remember if colib was a part of previous version.
but seems it's not in current package.

currently migrating on version 10  :cheekygreen:

BasilYercin

uhh didnt check all the previous topic about com and colib.

got my answer  :boohoo:

hutch--

The problem is the code in colib is over 10 years old and no-one has updated it since Ernie Murphy wrote it so I left it out to save room for other things that other people have needed over time. Although not the same thing, Biterider's project is current and regularly maintained so it may be worth you having a lok at it to see if that will do the job. There is no reason why you cannot use the existing version from version 9.0, it has not changed much for a very long time.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

ToutEnMasm

I took this old post trying to find another way to do what the library does.

Midl is a powerful tool who is abble to generate c source code.
C source code for what ?... for com libraries.
An odl file is enough to create a dll.
Needed for that,the sdk,the ddk (com libraries are here) and the vc++ express.All this thinks are downloadable for free.
It seems that the more difficult part can be done by cl and midl.

here is a batch file to illustrate this
Quote
@echo off
call C:\PROGRA~1\MICROS~1.0\Common7\Tools\vsvars32.bat
SET LIB=%LIB%C:\WinDDK\6001.18001\lib\wxp\i386;
SET LIBPATH=%LIBPATH%C:\WinDDK\6001.18001\lib\wxp\i386;

REM RpcRT4.lib
midl /app_config papint.idl
CL /c /DWIN32 /DREGISTER_PROXY_DLL dlldata.c
CL /c /DWIN32 /DREGISTER_PROXY_DLL /DPROXY_CLSID=7a98c250-6808-11cf-b73b-00aa00b677a7 /Fopapint.obj papint_p.c
CL /c /DWIN32 /DREGISTER_PROXY_DLL /Foiids.obj papint_i.c
link /dll /def:papint.def dlldata.obj papint.obj iids.obj RpcRT4.lib kernel32.lib rpcndr.lib rpcns4.lib uuid.lib  >> build.txt
pause


The odl file is as follow without library declarationsdk sample
[quote
/*+==========================================================================
  File:      PAPINT.IDL

  Summary:   Interface definition file for use by the MIDL compiler.
             Specifies the following custom interfaces: ISharePaper and
             IPaperSink.

             Compilation of this file using the MIDL.EXE compiler
             generates additional source files PAPINT.H, PAPINT_I.C,
             PAPINT_P.C, and DLLDATA.C.  They are in turn compiled in the
             Makefile to produce the marshaling server which is used by
             later code samples to provide standard marshaling for the
             ISharePaper and IPaperSink custom interfaces.

  Origin:    8-23-97: atrent - Editor inheritance from MARSHAL sample.

----------------------------------------------------------------------------
  This file is part of the Microsoft COM Tutorial Code Samples.

  Copyright (C) 1995-1998 Microsoft Corporation.  All rights reserved.

  This source code is intended only as a supplement to Microsoft
  Development Tools and/or on-line documentation.  See these other
  materials for detailed information regarding Microsoft code samples.

  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  PARTICULAR PURPOSE.
==========================================================================+*/


[uuid(0002da31-0000-0000-c000-000000000046),
    object
]
interface ISharePaper : IUnknown
{
  import "unknwn.idl";

  HRESULT InitPaper(
            [in,out] RECT* pWinRect,
            [out]    BOOL* pbFirst);
  HRESULT Lock(
            [in] BOOL bLock);
  HRESULT Load(
            [out] RECT* pWinRect);
  HRESULT Save(
            void);
  HRESULT InkStart(
            [in] SHORT nX,
            [in] SHORT nY,
            [in] SHORT nInkWidth,
            [in] COLORREF crInkColor);
  HRESULT InkDraw(
            [in] SHORT nX,
            [in] SHORT nY);
  HRESULT InkStop(
            [in] SHORT nX,
            [in] SHORT nY);
  HRESULT GetInk(
            [in] LONG lIndex,
            [out] SHORT* pnInkType,
            [out] SHORT* pnX,
            [out] SHORT* pnY,
            [out] SHORT* pnInkWidth,
            [out] COLORREF* pcrInkColor);
  HRESULT Erase(
            void);
  HRESULT Resize(
            [in] LONG lWidth,
            [in] LONG lHeight);
}

[uuid(0002da34-0000-0000-c000-000000000046),
    object
]
interface IPaperSink : IUnknown
{
  import "unknwn.idl";

  HRESULT Locked(
            void);
  HRESULT Unlocked(
            void);
  HRESULT Loaded(
            void);
  HRESULT Saved(
            void);
  HRESULT InkStart(
            [in] SHORT nX,
            [in] SHORT nY,
            [in] SHORT nInkWidth,
            [in] COLORREF crInkColor);
  HRESULT InkDraw(
            [in] SHORT nX,
            [in] SHORT nY);
  HRESULT InkStop(
            [in] SHORT nX,
            [in] SHORT nY);
  HRESULT Erased(
            void);
  HRESULT Resized(
            [in] LONG lWidth,
            [in] LONG lHeight);
}

cpp_quote ("// The types of Ink Data.")
cpp_quote ("#define INKTYPE_NONE  0")
cpp_quote ("#define INKTYPE_START 1")
cpp_quote ("#define INKTYPE_DRAW  2")
cpp_quote ("#define INKTYPE_STOP  3")
quote]

Anybody have experiment this ?