Witam.
mam problem z WinApi w własnym dll'u
Z niewiadomych mi przyczyn MessageBoxA działa poprawnie lecz dla SendMessage i lvm_getitemcount wywala błędy
1>c:\users\xxx\documents\visual studio 2010\projects\qqq\qqq\qqq.cpp(6): error C2065: 'lvm_getitemcount' : undeclared identifier
1>c:\users\xxx\documents\visual studio 2010\projects\qqq\qqq\qqq.cpp(6): error C3861: 'sendmessage': identifier not found
wcześniej jak kompilowałem do konsoli nie było takich problemów
Moim celem jest napisanie funkcji wypełniającej ListView, wiem jak to zrealizować lecz kompletnie nie znam się na c/c++, jedyny jaki znam to AutoHokey na poziomie średnio zaawansowanym i teraz próbuję napisać wstawki w c/asm bo AHK ma kiepską wydajność w bardziej rozległych funkcjach.
qqq.cpp
#include "stdafx.h"
#include "qqqq.h"
int API_Init(int h)
{
int num = sendmessage(h,lvm_getitemcount,0,0);
//(...) OTHER CODE
MessageBoxA(NULL,"Text","Title",MB_OK);
return h;
}
qqqq.h
#define DllExport extern "C" __declspec( dllexport )
DllExport int API_Init(int);
stdafx.h
// stdafx.cpp : source file that includes just the standard includes
// qqq.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
#include <windows.h>
#include <stdlib.h> // for itoa() call
#include <stdio.h> // for printf() call
#include <commctrl.h>
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
dodanie znaczników <code class="cpp"> - furious programming