|
Have you Googled for such, or checked MSDN?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Pls help me solve it...
I got this error when I compile with VS 2005, pls help me.
------ Build started: Project: VLTKLib, Configuration: Debug Win32 ------
Compiling...
pHandle.cpp
Linking...
pHandle.obj : error LNK2028: unresolved token (0A000299) "extern "C" struct HWND__ * __stdcall FindWindowW(wchar_t const *,wchar_t const *)" (?FindWindowW@@$$J18YGPAUHWND__@@PB_W0@Z) referenced in function "public: void __thiscall VLTKLib::pHandle::setHandle(char *,char *)" (?setHandle@pHandle@VLTKLib@@$$FQAEXPAD0@Z)
pHandle.obj : error LNK2028: unresolved token (0A00029B) "extern "C" unsigned long __stdcall GetWindowThreadProcessId(struct HWND__ *,unsigned long *)" (?GetWindowThreadProcessId@@$$J18YGKPAUHWND__@@PAK@Z) referenced in function "public: void __thiscall VLTKLib::pHandle::setHandle(struct HWND__ *)" (?setHandle@pHandle@VLTKLib@@$$FQAEXPAUHWND__@@@Z)
pHandle.obj : error LNK2019: unresolved external symbol "extern "C" unsigned long __stdcall GetWindowThreadProcessId(struct HWND__ *,unsigned long *)" (?GetWindowThreadProcessId@@$$J18YGKPAUHWND__@@PAK@Z) referenced in function "public: void __thiscall VLTKLib::pHandle::setHandle(struct HWND__ *)" (?setHandle@pHandle@VLTKLib@@$$FQAEXPAUHWND__@@@Z)
pHandle.obj : error LNK2019: unresolved external symbol "extern "C" struct HWND__ * __stdcall FindWindowW(wchar_t const *,wchar_t const *)" (?FindWindowW@@$$J18YGPAUHWND__@@PB_W0@Z) referenced in function "public: void __thiscall VLTKLib::pHandle::setHandle(char *,char *)" (?setHandle@pHandle@VLTKLib@@$$FQAEXPAD0@Z)
d:\workspace\VLTK\Debug\VLTKLib.dll : fatal error LNK1120: 4 unresolved externals
Build log was saved at "file://d:\workspace\VLTK\VLTKLib\Debug\BuildLog.htm"
VLTKLib - 5 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
My class:
pHandle.h
#pragma once
#include <string>
#include <stdlib.h>
#include <Windows.h>
namespace VLTKLib
{
public class pHandle
{
private:
HANDLE hProcess;
public:
pHandle(void);
pHandle(HWND curWin);
pHandle(char *winClass, char *winTitle);
~pHandle(void);
void setHandle(HWND curWin);
void setHandle(char *winClass, char *winTitle);
void closeHandle();
long ReadInt(LPBYTE lpAddress);
short ReadWord(LPBYTE lpAddress);
char ReadChar(LPBYTE lpAddress);
char *ReadString(LPBYTE lpAddress, int szChar);
};
}
pHandle.cpp
#include "StdAfx.h"
#include "pHandle.h"
#include <string>
#include <stdlib.h>
#include <Windows.h>
namespace VLTKLib
{
pHandle::pHandle(void)
{
}
pHandle::pHandle(HWND curWin)
{
setHandle(curWin);
}
pHandle::pHandle(char *winClass=NULL, char *winTitle=NULL)
{
setHandle(winClass, winTitle);
}
pHandle::~pHandle(void)
{
CloseHandle(hProcess);
}
void pHandle::setHandle(HWND curWin)
{
DWORD dwProcessID;
::GetWindowThreadProcessId(curWin, &dwProcessID);
hProcess = OpenProcess(PROCESS_VM_READ|PROCESS_VM_WRITE , FALSE, dwProcessID);
if (!hProcess) {
return;
}
}
void pHandle::setHandle(char *winClass=NULL, char *winTitle=NULL)
{
HWND curWin = FindWindow((LPCWSTR)winClass,(LPCWSTR)winTitle);
setHandle(curWin);
}
}
Tks a lot.
-- modified at 2:36 Monday 20th August, 2007
|
|
|
|
|
Have you used /NODEFAULTLIB linker option , by accident ?
Prasad
MS MVP - VC++
|
|
|
|
|
How to check it? I did not change any thing.
Tks for your help.
|
|
|
|
|
Check Project setting-->configuration properties-->Input-->Ignore All default lib. set it to No if, if it is yes.
Prasad
MS MVP - VC++
|
|
|
|
|
Did you import User32.lib ?
|
|
|
|
|
How to import User32.lib?
Tks for your help.
|
|
|
|
|
Right click on your project and select property on the solution window go to linker of tree list on the left panel open it and select input and enter this file at Additional Dependencies.
|
|
|
|
|
|
|
HWND curWin = FindWindow((LPCWSTR)winClass,(LPCWSTR)winTitle) - error !!!
FindWindowW(wchar_t const *,wchar_t const *)
- postfiks 'W' mean that the funktion use wchar_t instead char.
And you can convert char* to wchar_t* by using _TEXT("") macros.
And look here -> pHandle::setHandle(NULL) - wich of your function will be use?
|
|
|
|
|
Tks for your reply.
I converted all char * to wchar_t const as same as definetion of function, but I still got that errors.
void pHandle::setHandle(wchar_t const *winClass, wchar_t const *winTitle)
{
HWND curWin = FindWindow(winClass,winTitle);
setHandle(curWin);
}
Tks for your help
|
|
|
|
|
In Visual C++ 6.0, I want to run an application, such as Notepad.exe,... How must I do? Please help me!!! I'm in dark!
Thank you very much!
|
|
|
|
|
nps_ltv wrote: run an application, such as Notepad.exe,...
Here's the light You can use:
ShellExecute(/*parameters*/);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
can anybody tell me how to convert the excel format to .csv format....
|
|
|
|
|
File --> Save As...
Maxwell Chen
|
|
|
|
|
i need to convert from the excel format to csv format programatically using vc++.Cna anybody help me out
|
|
|
|
|
do u know how to use the MS excel classes and functions using COM
if you know then it is possible.
you have to use 'xlCSVMSDOS' the fileformat instead of 'xlNormal'
when you save the file.
if you do not know then do let me know
or use this link http://www.codeproject.com/database/cspreadsheet.asp[^]
Regards,
Pankaj Sachdeva
"There is no future lies in any job"
"but"
"future lies in the person who holds the job"
|
|
|
|
|
i dont know it because i am new to vc++ and its my first time i am using excel... so could you pls let me know how to do it
|
|
|
|
|
If you are new to vc++ I dont think you can use of any article easily its better first you try to learn c++.
Good luck;)
|
|
|
|
|
See here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
You cross posted and you are not giving your questions titles with any meaning. Please read the forum guidelines.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
I'm using CRectTracker alongside another class that uses SetWindowLongPtr to subclass my CScrollView class.
Problem is when I perform a CRectTracker::Track() or CRectTracker::TrackRubberBand() the CRectTracker hogs all the messages and my subclass WndProc gets none until the Track method returns.
Is there a way to make CRectTracker behave and pass messages on down the chain while tracking?
|
|
|
|