|
View Full Version : Problema com aplicação migrada de VC++ 6 para VC++ 2005 (8.0)
Juliano Nunes 04-29-2006, 09:59 PM Galera, peguei uma aplicação construÃda no VC++ 6 que trabalha com a API do
Windows e converti para VC++ 2005, ela executou perfeitamente, quer dizer,
não houve erro de compilação, mas não funcionou como a aplicação original.
Tenho que configurar algo para que o projeto do VC++ 2005 trabalhe com APIs e
código não gerenciado sem problemas?
--
Obs: Se a resposta foi útil ou responde sua dúvida, classifique-a.
[]''s
Juliano
Desenvolvedor .Net
Vice-Presidente MUG-RS-Desenvolvimento
http://thespoke.net/blogs/juliano_netfox/default.aspx
Clebson Derivan 05-02-2006, 06:21 PM Oi Juliano,
você migrou abrindo o DSW e pedindo pra converter ? ou criou projeto novo e
saiu copiando os arquivos do projeto antigo ?
pq tipo, se tu usou o wizard com certeza ele nao colocou a opcao /clr
(common language runtime). você vai querer usar codigo gerenciado ?
e o que esta dando errado exatamente ?
[]'s
Clebson
"Juliano Nunes" escreveu:
> Galera, peguei uma aplicação construÃda no VC++ 6 que trabalha com a API do
> Windows e converti para VC++ 2005, ela executou perfeitamente, quer dizer,
> não houve erro de compilação, mas não funcionou como a aplicação original.
> Tenho que configurar algo para que o projeto do VC++ 2005 trabalhe com APIs e
> código não gerenciado sem problemas?
> --
> Obs: Se a resposta foi útil ou responde sua dúvida, classifique-a.
>
> []''s
> Juliano
>
> Desenvolvedor .Net
> Vice-Presidente MUG-RS-Desenvolvimento
> http://thespoke.net/blogs/juliano_netfox/default.aspx
Juliano Nunes 05-05-2006, 04:50 AM Clebson, mandei o VC++ 2005 abrir o DSW e mandei converter o projeto inteiro.
Quando compilo e executo não dá erro nenhum com a configuração normal após a
conversão, mas quando vou nas propriedades do projeto e marco ele como MFC no
Visual Studio 2005, ele dá uma série de erros.
Warning 1 warning C4996: 'strcpy' was declared deprecated d:\Escola\PIM
2006\Hooking the native API and controlling process creation on a system-wide
basis_SOURCE\protector_app\protector\protector.cpp 36
Warning 2 warning C4996: 'stricmp' was declared deprecated d:\Escola\PIM
2006\Hooking the native API and controlling process creation on a system-wide
basis_SOURCE\protector_app\protector\protector.cpp 78
Warning 3 warning C4996: 'strcpy' was declared deprecated d:\Escola\PIM
2006\Hooking the native API and controlling process creation on a system-wide
basis_SOURCE\protector_app\protector\protector.cpp 83
Warning 4 warning C4996: 'strcat' was declared deprecated d:\Escola\PIM
2006\Hooking the native API and controlling process creation on a system-wide
basis_SOURCE\protector_app\protector\protector.cpp 84
Warning 5 warning C4101: 'ps' : unreferenced local variable d:\Escola\PIM
2006\Hooking the native API and controlling process creation on a system-wide
basis_SOURCE\protector_app\protector\protector.cpp 245
Warning 6 warning C4101: 'hdc' : unreferenced local variable d:\Escola\PIM
2006\Hooking the native API and controlling process creation on a system-wide
basis_SOURCE\protector_app\protector\protector.cpp 246
Error 7 error LNK2019: unresolved external symbol
__imp__CloseServiceHandle@4 referenced in function "void __cdecl setup(void)"
(?setup@@YAXXZ) protector.obj
Error 8 error LNK2019: unresolved external symbol __imp__StartServiceA@12
referenced in function "void __cdecl setup(void)" (?setup@@YAXXZ)
protector.obj
Error 9 error LNK2019: unresolved external symbol __imp__CreateServiceA@52
referenced in function "void __cdecl setup(void)" (?setup@@YAXXZ)
protector.obj
Error 10 error LNK2019: unresolved external symbol __imp__OpenSCManagerA@12
referenced in function "void __cdecl setup(void)" (?setup@@YAXXZ)
protector.obj
Error 11 error LNK2019: unresolved external symbol __imp__DeleteService@4
referenced in function "void __cdecl cleanup(void)" (?cleanup@@YAXXZ)
protector.obj
Error 12 error LNK2019: unresolved external symbol __imp__ControlService@12
referenced in function "void __cdecl cleanup(void)" (?cleanup@@YAXXZ)
protector.obj
Error 13 error LNK2019: unresolved external symbol __imp__OpenServiceA@12
referenced in function "void __cdecl cleanup(void)" (?cleanup@@YAXXZ)
protector.obj
Error 14 error LNK2019: unresolved external symbol __imp__MessageBoxA@16
referenced in function "void __cdecl thread(void)" (?thread@@YAXXZ)
protector.obj
Error 15 error LNK2019: unresolved external symbol __imp__DispatchMessageA@4
referenced in function _WinMain@16 protector.obj
Error 16 error LNK2019: unresolved external symbol __imp__TranslateMessage@4
referenced in function _WinMain@16 protector.obj
Error 17 error LNK2019: unresolved external symbol
__imp__TranslateAcceleratorA@12 referenced in function _WinMain@16
protector.obj
Error 18 error LNK2019: unresolved external symbol __imp__GetMessageA@16
referenced in function _WinMain@16 protector.obj
Error 19 error LNK2019: unresolved external symbol
__imp__LoadAcceleratorsA@8 referenced in function _WinMain@16 protector.obj
Error 20 error LNK2019: unresolved external symbol __imp__LoadStringA@16
referenced in function _WinMain@16 protector.obj
Error 21 error LNK2019: unresolved external symbol __imp__RegisterClassExA@4
referenced in function "unsigned short __cdecl MyRegisterClass(struct
HINSTANCE__ *)" (?MyRegisterClass@@YAGPAUHINSTANCE__@@@Z) protector.obj
Error 22 error LNK2019: unresolved external symbol __imp__LoadCursorA@8
referenced in function "unsigned short __cdecl MyRegisterClass(struct
HINSTANCE__ *)" (?MyRegisterClass@@YAGPAUHINSTANCE__@@@Z) protector.obj
Error 23 error LNK2019: unresolved external symbol __imp__LoadIconA@8
referenced in function "unsigned short __cdecl MyRegisterClass(struct
HINSTANCE__ *)" (?MyRegisterClass@@YAGPAUHINSTANCE__@@@Z) protector.obj
Error 24 error LNK2019: unresolved external symbol __imp__UpdateWindow@4
referenced in function "int __cdecl InitInstance(struct HINSTANCE__ *,int)"
(?InitInstance@@YAHPAUHINSTANCE__@@H@Z) protector.obj
Error 25 error LNK2019: unresolved external symbol __imp__ShowWindow@8
referenced in function "int __cdecl InitInstance(struct HINSTANCE__ *,int)"
(?InitInstance@@YAHPAUHINSTANCE__@@H@Z) protector.obj
Error 26 error LNK2019: unresolved external symbol __imp__CreateWindowExA@48
referenced in function "int __cdecl InitInstance(struct HINSTANCE__ *,int)"
(?InitInstance@@YAHPAUHINSTANCE__@@H@Z) protector.obj
Error 27 error LNK2019: unresolved external symbol __imp__PostQuitMessage@4
referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned
int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) protector.obj
Error 28 error LNK2019: unresolved external symbol __imp__DefWindowProcA@16
referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned
int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) protector.obj
Error 29 error LNK2019: unresolved external symbol __imp__DestroyWindow@4
referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned
int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) protector.obj
Error 30 error LNK2019: unresolved external symbol __imp__DialogBoxParamA@20
referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned
int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) protector.obj
Error 31 error LNK2019: unresolved external symbol __imp__EndDialog@8
referenced in function "long __stdcall About(struct HWND__ *,unsigned
int,unsigned int,long)" (?About@@YGJPAUHWND__@@IIJ@Z) protector.obj
Error 32 fatal error LNK1120: 25 unresolved externals d:\Escola\PIM
2006\Hooking the native API and controlling process creation on a system-wide
basis_SOURCE\protector_app\protector\Debug\protector.exe 1
--
Obs: Se a resposta foi útil ou responde sua dúvida, classifique-a.
[]''s
Juliano
Desenvolvedor .Net
Vice-Presidente MUG-RS-Desenvolvimento
http://thespoke.net/blogs/juliano_netfox/default.aspx
"Clebson Derivan" escreveu:
> Oi Juliano,
> você migrou abrindo o DSW e pedindo pra converter ? ou criou projeto novo e
> saiu copiando os arquivos do projeto antigo ?
>
> pq tipo, se tu usou o wizard com certeza ele nao colocou a opcao /clr
> (common language runtime). você vai querer usar codigo gerenciado ?
>
> e o que esta dando errado exatamente ?
>
> []'s
> Clebson
> "Juliano Nunes" escreveu:
>
> > Galera, peguei uma aplicação construÃda no VC++ 6 que trabalha com a API do
> > Windows e converti para VC++ 2005, ela executou perfeitamente, quer dizer,
> > não houve erro de compilação, mas não funcionou como a aplicação original.
> > Tenho que configurar algo para que o projeto do VC++ 2005 trabalhe com APIs e
> > código não gerenciado sem problemas?
> > --
> > Obs: Se a resposta foi útil ou responde sua dúvida, classifique-a.
> >
> > []''s
> > Juliano
> >
> > Desenvolvedor .Net
> > Vice-Presidente MUG-RS-Desenvolvimento
> > http://thespoke.net/blogs/juliano_netfox/default.aspx
Frederico Pissarra 05-05-2006, 01:37 PM Os Warnings de 1 a 4 dizem que vc está usando funções que podem provocar
falhas de segurança... Considere trocar as funções como manda o MSDN ou as
desconsidere (existe um símbolo que disabilita esses warnings CRT_ alguma
coisa [não me lembro agora]).
Os Warnings 5 e 6 dizem que vc variáveis locais que não estão em uso.
Os demais erros são erros do linker, significa que vc "esqueceu" de linkar
os arquivos .lib necessários para sua aplicação rodar. No caso, parece que
vc "esqueceu" do kernel32.lib, user32.lib, advapi32.lib
[]s
Fred
"Juliano Nunes" <JulianoNunes@discussions.microsoft.com> escreveu na
mensagem news:65948BBD-5429-4CC6-B3A1-BE6FB2E1B918@microsoft.com...
> Clebson, mandei o VC++ 2005 abrir o DSW e mandei converter o projeto
> inteiro.
>
> Quando compilo e executo não dá erro nenhum com a configuração normal após
> a
> conversão, mas quando vou nas propriedades do projeto e marco ele como MFC
> no
> Visual Studio 2005, ele dá uma série de erros.
>
> Warning 1 warning C4996: 'strcpy' was declared deprecated d:\Escola\PIM
> 2006\Hooking the native API and controlling process creation on a
> system-wide
> basis_SOURCE\protector_app\protector\protector.cpp 36
>
> Warning 2 warning C4996: 'stricmp' was declared deprecated d:\Escola\PIM
> 2006\Hooking the native API and controlling process creation on a
> system-wide
> basis_SOURCE\protector_app\protector\protector.cpp 78
>
> Warning 3 warning C4996: 'strcpy' was declared deprecated d:\Escola\PIM
> 2006\Hooking the native API and controlling process creation on a
> system-wide
> basis_SOURCE\protector_app\protector\protector.cpp 83
>
> Warning 4 warning C4996: 'strcat' was declared deprecated d:\Escola\PIM
> 2006\Hooking the native API and controlling process creation on a
> system-wide
> basis_SOURCE\protector_app\protector\protector.cpp 84
>
> Warning 5 warning C4101: 'ps' : unreferenced local variable d:\Escola\PIM
> 2006\Hooking the native API and controlling process creation on a
> system-wide
> basis_SOURCE\protector_app\protector\protector.cpp 245
>
> Warning 6 warning C4101: 'hdc' : unreferenced local variable d:\Escola\PIM
> 2006\Hooking the native API and controlling process creation on a
> system-wide
> basis_SOURCE\protector_app\protector\protector.cpp 246
>
> Error 7 error LNK2019: unresolved external symbol
> __imp__CloseServiceHandle@4 referenced in function "void __cdecl
> setup(void)"
> (?setup@@YAXXZ) protector.obj
>
> Error 8 error LNK2019: unresolved external symbol __imp__StartServiceA@12
> referenced in function "void __cdecl setup(void)" (?setup@@YAXXZ)
> protector.obj
>
> Error 9 error LNK2019: unresolved external symbol __imp__CreateServiceA@52
> referenced in function "void __cdecl setup(void)" (?setup@@YAXXZ)
> protector.obj
>
> Error 10 error LNK2019: unresolved external symbol
> __imp__OpenSCManagerA@12
> referenced in function "void __cdecl setup(void)" (?setup@@YAXXZ)
> protector.obj
>
> Error 11 error LNK2019: unresolved external symbol __imp__DeleteService@4
> referenced in function "void __cdecl cleanup(void)" (?cleanup@@YAXXZ)
> protector.obj
>
> Error 12 error LNK2019: unresolved external symbol
> __imp__ControlService@12
> referenced in function "void __cdecl cleanup(void)" (?cleanup@@YAXXZ)
> protector.obj
>
> Error 13 error LNK2019: unresolved external symbol __imp__OpenServiceA@12
> referenced in function "void __cdecl cleanup(void)" (?cleanup@@YAXXZ)
> protector.obj
>
> Error 14 error LNK2019: unresolved external symbol __imp__MessageBoxA@16
> referenced in function "void __cdecl thread(void)" (?thread@@YAXXZ)
> protector.obj
>
> Error 15 error LNK2019: unresolved external symbol
> __imp__DispatchMessageA@4
> referenced in function _WinMain@16 protector.obj
>
> Error 16 error LNK2019: unresolved external symbol
> __imp__TranslateMessage@4
> referenced in function _WinMain@16 protector.obj
>
> Error 17 error LNK2019: unresolved external symbol
> __imp__TranslateAcceleratorA@12 referenced in function _WinMain@16
> protector.obj
>
> Error 18 error LNK2019: unresolved external symbol __imp__GetMessageA@16
> referenced in function _WinMain@16 protector.obj
>
> Error 19 error LNK2019: unresolved external symbol
> __imp__LoadAcceleratorsA@8 referenced in function _WinMain@16
> protector.obj
>
> Error 20 error LNK2019: unresolved external symbol __imp__LoadStringA@16
> referenced in function _WinMain@16 protector.obj
>
> Error 21 error LNK2019: unresolved external symbol
> __imp__RegisterClassExA@4
> referenced in function "unsigned short __cdecl MyRegisterClass(struct
> HINSTANCE__ *)" (?MyRegisterClass@@YAGPAUHINSTANCE__@@@Z) protector.obj
>
> Error 22 error LNK2019: unresolved external symbol __imp__LoadCursorA@8
> referenced in function "unsigned short __cdecl MyRegisterClass(struct
> HINSTANCE__ *)" (?MyRegisterClass@@YAGPAUHINSTANCE__@@@Z) protector.obj
>
> Error 23 error LNK2019: unresolved external symbol __imp__LoadIconA@8
> referenced in function "unsigned short __cdecl MyRegisterClass(struct
> HINSTANCE__ *)" (?MyRegisterClass@@YAGPAUHINSTANCE__@@@Z) protector.obj
>
> Error 24 error LNK2019: unresolved external symbol __imp__UpdateWindow@4
> referenced in function "int __cdecl InitInstance(struct HINSTANCE__
> *,int)"
> (?InitInstance@@YAHPAUHINSTANCE__@@H@Z) protector.obj
>
> Error 25 error LNK2019: unresolved external symbol __imp__ShowWindow@8
> referenced in function "int __cdecl InitInstance(struct HINSTANCE__
> *,int)"
> (?InitInstance@@YAHPAUHINSTANCE__@@H@Z) protector.obj
>
> Error 26 error LNK2019: unresolved external symbol
> __imp__CreateWindowExA@48
> referenced in function "int __cdecl InitInstance(struct HINSTANCE__
> *,int)"
> (?InitInstance@@YAHPAUHINSTANCE__@@H@Z) protector.obj
>
> Error 27 error LNK2019: unresolved external symbol
> __imp__PostQuitMessage@4
> referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned
> int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) protector.obj
>
> Error 28 error LNK2019: unresolved external symbol
> __imp__DefWindowProcA@16
> referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned
> int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) protector.obj
>
> Error 29 error LNK2019: unresolved external symbol __imp__DestroyWindow@4
> referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned
> int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) protector.obj
>
> Error 30 error LNK2019: unresolved external symbol
> __imp__DialogBoxParamA@20
> referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned
> int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) protector.obj
>
> Error 31 error LNK2019: unresolved external symbol __imp__EndDialog@8
> referenced in function "long __stdcall About(struct HWND__ *,unsigned
> int,unsigned int,long)" (?About@@YGJPAUHWND__@@IIJ@Z) protector.obj
>
> Error 32 fatal error LNK1120: 25 unresolved externals d:\Escola\PIM
> 2006\Hooking the native API and controlling process creation on a
> system-wide
> basis_SOURCE\protector_app\protector\Debug\protector.exe 1
>
>
>
> --
> Obs: Se a resposta foi útil ou responde sua dúvida, classifique-a.
>
> []''s
> Juliano
>
> Desenvolvedor .Net
> Vice-Presidente MUG-RS-Desenvolvimento
> http://thespoke.net/blogs/juliano_netfox/default.aspx
>
>
> "Clebson Derivan" escreveu:
>
>> Oi Juliano,
>> você migrou abrindo o DSW e pedindo pra converter ? ou criou projeto novo
>> e
>> saiu copiando os arquivos do projeto antigo ?
>>
>> pq tipo, se tu usou o wizard com certeza ele nao colocou a opcao /clr
>> (common language runtime). você vai querer usar codigo gerenciado ?
>>
>> e o que esta dando errado exatamente ?
>>
>> []'s
>> Clebson
>> "Juliano Nunes" escreveu:
>>
>> > Galera, peguei uma aplicação construída no VC++ 6 que trabalha com a
>> > API do
>> > Windows e converti para VC++ 2005, ela executou perfeitamente, quer
>> > dizer,
>> > não houve erro de compilação, mas não funcionou como a aplicação
>> > original.
>> > Tenho que configurar algo para que o projeto do VC++ 2005 trabalhe com
>> > APIs e
>> > código não gerenciado sem problemas?
>> > --
>> > Obs: Se a resposta foi útil ou responde sua dúvida, classifique-a.
>> >
>> > []''s
>> > Juliano
>> >
>> > Desenvolvedor .Net
>> > Vice-Presidente MUG-RS-Desenvolvimento
>> > http://thespoke.net/blogs/juliano_netfox/default.aspx
|
|
|