Hello!

I'm currently developing class for loading resources from resource-only DLL. And I've encounterd one quite strange error. My function looks like this:

Code:
Public Function LoadPicResource(pic as PictureBox, id as long, resType as String) as Boolean

''
'' here is some other code
''
Set pic.Picture = LoadPicture(sFile)

End Function
When I try to compile it, I get compile error: Private object modules cannot be used in public object modules as parameters or return types for public procedures, as public data members, or as field of public user defined types.
I presume that error occured because of "pic as PictureBox", but I don't know how to repair that. I tried also like this:

Code:
Public Function LoadPicResource(id as long, resType as String) as StdPicure 

''
'' here is some other code
''
Set LoadPicResource = LoadPicture(sFile)

End Function
But that also didn't work. When when I tried to run it and it came to line "Set LoadPicResource = LoadPicture(sFile)" it generated an error and VB then crashed. The error was "50002 - Unexpected error". I also tried to define my function as IPictureDisp but VB also crashed. I just don't get it why this happens, because LoadPicture() function is also declared as IPictureDisp.

Is there any way that I can create picture directly to PictureBox through hWnd property or something like that?

Zvonko