From: Neha on
Hi all

I am porting a application from win32 to Wince5.0(platform builder) and
i compiled it very well but when i try to run it .. doesn't show me
intial dialogbox, when i extract the err from GetLastError() its give
ERROR_RESOURCE_NAME_NOT_FOUND (1814 - 0x000716) !!

As of now i am able to see my resource file in rsource editor and also
in design view I added resource.h in .rc and also in main cpp file.
I also checked my .rc file, way of writing dialog and calling method
etc thats are same as given in MSDN. But still i am not able to load
the dialog, its always says "Dialog resource not loaded" .

Thats my dialog call :::

DialogBox(hInst, MAKEINTRESOURCE (IDD_DLGSFPH), hWnd, (DLGPROC)SoftPh);

In resource.h there is IDD_DLGSFPH defined and also in .rc its written
as fallow.

DD_DLGSFPH DIALOG DISCARDABLE 0, 0, 188, 180

Can anyone tell me what wrong i done or how to load resource in WinCE .
please help me !

Thanks in Advance
Neha

From: Norman Bullen on
Neha wrote:
> Hi all
>
> I am porting a application from win32 to Wince5.0(platform builder) and
> i compiled it very well but when i try to run it .. doesn't show me
> intial dialogbox, when i extract the err from GetLastError() its give
> ERROR_RESOURCE_NAME_NOT_FOUND (1814 - 0x000716) !!
>
> As of now i am able to see my resource file in rsource editor and also
> in design view I added resource.h in .rc and also in main cpp file.
> I also checked my .rc file, way of writing dialog and calling method
> etc thats are same as given in MSDN. But still i am not able to load
> the dialog, its always says "Dialog resource not loaded" .
>
> Thats my dialog call :::
>
> DialogBox(hInst, MAKEINTRESOURCE (IDD_DLGSFPH), hWnd, (DLGPROC)SoftPh);
>
> In resource.h there is IDD_DLGSFPH defined and also in .rc its written
> as fallow.
>
> DD_DLGSFPH DIALOG DISCARDABLE 0, 0, 188, 180
>
> Can anyone tell me what wrong i done or how to load resource in WinCE .
> please help me !
>
> Thanks in Advance
> Neha
>

I notice that you say IDD_DLGSFPH is defined in resource.h and that the
call to DialogBox() uses IDD_DLGSFPH but the DIALOG statement shown here
has DD_DLGSFPH. If that's actually the case in your .rc file, your
dialog has a string name of "DD_DLGSFPH", not a numeric name of IDD_DLGSFPH.

Otherwise, perhaps you didn't #include resource.h in your .rc file.

Also, never, never, use a cast when you're passing the name of a
callback function, (DLGPROC)SoftPh in this case, to another function.
Doing so can mask all sorts of errors that will cause your program to
fail in mysterious ways later on. Remove the cast and recompile the
program. If you get no errors, you didn't need the cast. If you do get
errors, it means your function SoftPh is not declared correctly to be a
dialog procedure callback function. Fix those problems.

Norm

--
--
To reply, change domain to an adult feline.

From: Neha on
Hi Norm


First of all thanks a lot for ur reply ..! As ppl doesn't reply if u
posted ur prob in all groups too...! thats why i posted in relvent all
groups might some one ans.!

Well i apologies for my mistake that i copied my code wrong, actualy i
written correct ID in .rc file .. its correct in it .

IDD_DLGSFPH DIALOG DISCARDABLE 0, 0, 188, 180

And i already mentioned that i included resource.h in my main .cpp and
also in .rc file.

Well i tried the to remove typecast in last parameter,but if u see the
MSDN they also mentioned in this same manner to calling dialog callback
funtion. Its giving error and not working. !

Can you please give anymore idea.

Thnx
Neha
Norman Bullen wrote:
> Neha wrote:
> > Hi all
> >
> > I am porting a application from win32 to Wince5.0(platform builder) and
> > i compiled it very well but when i try to run it .. doesn't show me
> > intial dialogbox, when i extract the err from GetLastError() its give
> > ERROR_RESOURCE_NAME_NOT_FOUND (1814 - 0x000716) !!
> >
> > As of now i am able to see my resource file in rsource editor and also
> > in design view I added resource.h in .rc and also in main cpp file.
> > I also checked my .rc file, way of writing dialog and calling method
> > etc thats are same as given in MSDN. But still i am not able to load
> > the dialog, its always says "Dialog resource not loaded" .
> >
> > Thats my dialog call :::
> >
> > DialogBox(hInst, MAKEINTRESOURCE (IDD_DLGSFPH), hWnd, (DLGPROC)SoftPh);
> >
> > In resource.h there is IDD_DLGSFPH defined and also in .rc its written
> > as fallow.
> >
> > DD_DLGSFPH DIALOG DISCARDABLE 0, 0, 188, 180
> >
> > Can anyone tell me what wrong i done or how to load resource in WinCE .
> > please help me !
> >
> > Thanks in Advance
> > Neha
> >
>
> I notice that you say IDD_DLGSFPH is defined in resource.h and that the
> call to DialogBox() uses IDD_DLGSFPH but the DIALOG statement shown here
> has DD_DLGSFPH. If that's actually the case in your .rc file, your
> dialog has a string name of "DD_DLGSFPH", not a numeric name of IDD_DLGSFPH.
>
> Otherwise, perhaps you didn't #include resource.h in your .rc file.
>
> Also, never, never, use a cast when you're passing the name of a
> callback function, (DLGPROC)SoftPh in this case, to another function.
> Doing so can mask all sorts of errors that will cause your program to
> fail in mysterious ways later on. Remove the cast and recompile the
> program. If you get no errors, you didn't need the cast. If you do get
> errors, it means your function SoftPh is not declared correctly to be a
> dialog procedure callback function. Fix those problems.
>
> Norm
>
> --
> --
> To reply, change domain to an adult feline.

From: Norman Bullen on
Neha wrote:
> Hi Norm
>
>
> First of all thanks a lot for ur reply ..! As ppl doesn't reply if u
> posted ur prob in all groups too...! thats why i posted in relvent all
> groups might some one ans.!
>
> Well i apologies for my mistake that i copied my code wrong, actualy i
> written correct ID in .rc file .. its correct in it .
>
> IDD_DLGSFPH DIALOG DISCARDABLE 0, 0, 188, 180
>
> And i already mentioned that i included resource.h in my main .cpp and
> also in .rc file.
>
> Well i tried the to remove typecast in last parameter,but if u see the
> MSDN they also mentioned in this same manner to calling dialog callback
> funtion. Its giving error and not working. !
>
> Can you please give anymore idea.
>
> Thnx
> Neha

Two other possibilities:
Perhaps the variable hInst does not contain the instance of the module
containing the dialog resource. Is you dialog resource in a DLL?

Perhaps the resource script is not linked into the module.

Norm

--
--
To reply, change domain to an adult feline.