Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > C/C++ программирование > Общие вопросы C/C++
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 12.06.2009, 09:30   #1
ImportDLL
Новичок
Джуниор
 
Регистрация: 12.06.2009
Сообщений: 2
Восклицание Динамическая загрузка DLL

Здравствуйте,
У меня возникла проблема с динамической загрузкой библиотеки. Есть один файл - ****.dll , который нужно подключить к проекту на MS Visual C++ 2005. Пробывал динамическую загрузку как в посте http://www.programmersforum.ru/showthread.php?t=38078
Но чего-то не получилось....

Кроме этого пробывал загрузить следующим образом:

#include <tchar.h>
#include <windows.h>

HINSTANCE H_DLL ;


H_Vcore=LoadLibrary("DLL.dll");//Загрузка библиотеки
if (H_Vcore)//Если загружена то:
{ ...

Помогите пожалуйста начинающему... Заранее очень благодарен!
ImportDLL вне форума Ответить с цитированием
Старый 12.06.2009, 09:45   #2
ImportDLL
Новичок
Джуниор
 
Регистрация: 12.06.2009
Сообщений: 2
По умолчанию

Вот ошибки при использовании вышеуказанного поста:

1>.\Main.cpp(43) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [8]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\Main.cpp(56) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'const char [7]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\Main.cpp(72) : error C2664: 'LoadLibraryExW' : cannot convert parameter 1 from 'const char [10]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\Main.cpp(78) : error C2664: 'lstrcpyW' : cannot convert parameter 1 from 'LPSTR' to 'LPWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\Main.cpp(79) : error C2664: 'lstrlenW' : cannot convert parameter 1 from 'LPSTR' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\Main.cpp(80) : error C2664: 'wsprintfW' : cannot convert parameter 1 from 'CHAR *' to 'LPWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\Main.cpp(85) : error C2664: 'wsprintfW' : cannot convert parameter 1 from 'CHAR *' to 'LPWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\Main.cpp(91) : error C2664: 'wsprintfW' : cannot convert parameter 1 from 'CHAR *' to 'LPWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\Main.cpp(125) : error C2440: '=' : cannot convert from 'CHAR [13]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\Main.cpp(138) : error C2664: 'CreateWindowExW' : cannot convert parameter 2 from 'CHAR [13]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>.\Main.cpp(146) : warning C4244: 'return' : conversion from 'WPARAM' to 'int', possible loss of data
1>Build log was saved at "file://f:\Мои документы\Visual Studio 2005\Projects\Tempik\Tempik\Debug\B uildLog.htm"
1>Tempik - 10 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
ImportDLL вне форума Ответить с цитированием
Старый 12.06.2009, 11:33   #3
pu4koff
Старожил
 
Аватар для pu4koff
 
Регистрация: 22.05.2007
Сообщений: 9,065
По умолчанию

У Вас в проекте юникод подключен. Или в настройках проекта Char set меняйте на not set (или как там уж я не помню. первый пункт там)
или перед всеми строками константными пишите L:
Пример: L"трям"
или _T("трям")
или TEXT("трям")
pu4koff вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц



Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Загрузка BitMap из DLL Македонский Мультимедиа в Delphi 2 02.06.2009 17:28
Динамическая память. Пaвeл Помощь студентам 16 31.05.2009 21:16
загрузка .dll blackstersl Общие вопросы Delphi 1 29.04.2009 21:53
Явная загрузка DLL FaTaL Общие вопросы Delphi 17 10.10.2008 08:57
Загрузка DLL Hollander Общие вопросы Delphi 3 21.05.2007 20:19