From: Kevin on
Hi all,

I have added an image in a DLL using the following code:

resource bmp_NoImage Bitmap C:\VOProjects\Membership\images\noimage.bmp
define bmp_NoImage := 5000

I want to use this image in a FabPaintLibCtrl object using the following
code, but the image fails to show up.
oFabImg := FabPaintLib{}
lSuccess := oFabImg:CreateFromResourceName(_GetInst(), "bmp_NoImage")
//lSuccess := oFabImg:CreateFromResourceID( _GetInst(), bmp_NoImage )

The result of creating from Resource, by ID or Name, fails. If I create
it from an external file the image is displayed correctly.

Does anyone know what I might be missing?

I am using VO2.8 on Windows 7 with the latest version of FabPaint.

Thanks in advance.

Kevin

From: Fabrice Foray on
Hi Kevin,
I will have a look at it, but the CreateFromResource is using the
following code :

// Load ressource
hBitmap := LoadBitmap( hInst, pszRes )
// Create from Bitmap Handle
ptrDIB := DIBCreateFromHBitmap( hBitmap )

Can you please check that LoadBitmap() is returning a valid (non null)
Handle ?

Also, are you manually loading the DLL using a LoadLibrary() ?

Regards,
Fabrice

On 21 avr, 14:29, "Kevin" <kdmur...(a)eircom.net> wrote:
> Hi all,
>
> I have added an image in a DLL using the following code:
>
> resource bmp_NoImage Bitmap C:\VOProjects\Membership\images\noimage.bmp
> define bmp_NoImage := 5000
>
> I want to use this image in a FabPaintLibCtrl object using the following
> code, but the image fails to show up.
> oFabImg := FabPaintLib{}
> lSuccess := oFabImg:CreateFromResourceName(_GetInst(), "bmp_NoImage")
> //lSuccess := oFabImg:CreateFromResourceID( _GetInst(), bmp_NoImage )
>
> The result of creating from Resource, by ID or Name, fails. If I create
> it from an external file the image is displayed correctly.
>
> Does anyone know what I might be missing?
>
> I am using VO2.8 on Windows 7 with the latest version of FabPaint.
>
> Thanks in advance.
>
> Kevin

From: Kevin on
Hi Fabrice,

I will check when back at that machine. When providing the resource /
name I was copying the value from where it was created.

The DLL is linked to the EXE so I don't need to use LoadLibrary.

Kevin


"Fabrice Foray" <fabrice.foray(a)gmail.com> wrote in message
news:c6450b1c-f664-434a-9ef8-5533a8a229b1(a)k36g2000yqb.googlegroups.com:

> Hi Kevin,
> I will have a look at it, but the CreateFromResource is using the
> following code :
>
> // Load ressource
> hBitmap := LoadBitmap( hInst, pszRes )
> // Create from Bitmap Handle
> ptrDIB := DIBCreateFromHBitmap( hBitmap )
>
> Can you please check that LoadBitmap() is returning a valid (non null)
> Handle ?
>
> Also, are you manually loading the DLL using a LoadLibrary() ?
>
> Regards,
> Fabrice
>
> On 21 avr, 14:29, "Kevin" <kdmur...(a)eircom.net> wrote:
> > Hi all,
> >
> > I have added an image in a DLL using the following code:
> >
> > resource bmp_NoImage Bitmap C:\VOProjects\Membership\images\noimage.bmp
> > define bmp_NoImage := 5000
> >
> > I want to use this image in a FabPaintLibCtrl object using the following
> > code, but the image fails to show up.
> > oFabImg := FabPaintLib{}
> > lSuccess := oFabImg:CreateFromResourceName(_GetInst(), "bmp_NoImage")
> > //lSuccess := oFabImg:CreateFromResourceID( _GetInst(), bmp_NoImage )
> >
> > The result of creating from Resource, by ID or Name, fails. If I create
> > it from an external file the image is displayed correctly.
> >
> > Does anyone know what I might be missing?
> >
> > I am using VO2.8 on Windows 7 with the latest version of FabPaint.
> >
> > Thanks in advance.
> >
> > Kevin

From: Geoff Schaller on
Actually Kevin you do.

....but it is probably in one of the Fab libs or functions which are
called during the loading of one of the classes if you are not
explicitly loading it.

Fabrice mentions this because you can load CAPaint or FabPaint or even a
later version from the original makers but at some point, it must be
loaded. Fabrice's question was around which method you used.

Geoff



"Kevin" <kdmurphy(a)eircom.net> wrote in message
news:sdFzn.903$I8.332(a)news.indigo.ie:

> Hi Fabrice,
>
> I will check when back at that machine. When providing the resource /
> name I was copying the value from where it was created.
>
> The DLL is linked to the EXE so I don't need to use LoadLibrary.
>
> Kevin
>
>
> "Fabrice Foray" <fabrice.foray(a)gmail.com> wrote in message
> news:c6450b1c-f664-434a-9ef8-5533a8a229b1(a)k36g2000yqb.googlegroups.com:
>
>
> > Hi Kevin,
> > I will have a look at it, but the CreateFromResource is using the
> > following code :
> >
> > // Load ressource
> > hBitmap := LoadBitmap( hInst, pszRes )
> > // Create from Bitmap Handle
> > ptrDIB := DIBCreateFromHBitmap( hBitmap )
> >
> > Can you please check that LoadBitmap() is returning a valid (non null)
> > Handle ?
> >
> > Also, are you manually loading the DLL using a LoadLibrary() ?
> >
> > Regards,
> > Fabrice
> >
> > On 21 avr, 14:29, "Kevin" <kdmur...(a)eircom.net> wrote:
>
> > > Hi all,
> > >
> > > I have added an image in a DLL using the following code:
> > >
> > > resource bmp_NoImage Bitmap C:\VOProjects\Membership\images\noimage.bmp
> > > define bmp_NoImage := 5000
> > >
> > > I want to use this image in a FabPaintLibCtrl object using the following
> > > code, but the image fails to show up.
> > > oFabImg := FabPaintLib{}
> > > lSuccess := oFabImg:CreateFromResourceName(_GetInst(), "bmp_NoImage")
> > > //lSuccess := oFabImg:CreateFromResourceID( _GetInst(), bmp_NoImage )
> > >
> > > The result of creating from Resource, by ID or Name, fails. If I create
> > > it from an external file the image is displayed correctly.
> > >
> > > Does anyone know what I might be missing?
> > >
> > > I am using VO2.8 on Windows 7 with the latest version of FabPaint.
> > >
> > > Thanks in advance.
> > >
> > > Kevin

 | 
Pages: 1
Prev: memo fields problem...
Next: Sending Message