|
|
In addition to the lack of error checking, what is the value of g_hCapFile after the call to CreateFileA() ? If it is INVALID_HANDLE_VALUE , then what does GetLastError() return?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
In this code only at the last line the system (if you try in debug mode) will give you the error: "calling convention is wron
bocbe
|
|
|
|
|
Hi All,
I have a makefile project and I want to call COM (ActiveX control) in the project.
The code to call COM in makefile is as follows:
Files included for COM support are:
#include <objbase.h>
#include <comdef.h>
#include <rpc.h>
#include <rpcndr.h>
#include <basetyps.h>
//I am just putting the COM calling code let me know if I m doing the right way.
HRESULT hr = CoInitialize(NULL);
if(FAILED(hr))
{
printf("CoInitialize Failed\n");
return 0;
}
IMyInterface* pInt = NULL;
hr = CoCreateInstance(CLSID_MyInterface, NULL, CLSCTX_INPROC_SERVER, IID_IMyInterface, reinterpret_cast<void**> (&pInt));
if(SUCCEEDED(hr))
pInt->Connect(); //This is the COM funtion that I want to use
pInt->Release();
CoUninitialize();
It compiles fine but when I try to build it gives me Linking Error...
MyClass.OBJ : error LNK2001: unresolved external symbol __imp__CoUninitialize@0
MyClass.OBJ : error LNK2001: unresolved external symbol __imp__CoCreateInstance@20
MyClass.OBJ : error LNK2001: unresolved external symbol __imp__CoInitialize@4
MyApplication.EXE : fatal error LNK1120: 3 unresolved externals
NMAKE : fatal error U1077: 'link' : return code '0x460'
Please help me on this. Thanks in advance.
Ashok
|
|
|
|
|
Sounds like you need to add ole32.lib to the project's lib files.
|
|
|
|
|
Hi community,
how can i write to clipboard memory, for example, strings with ctrl + c, and put them with ctrl + v in to an textfield???
How to use this memory???
thanx a lot!
break;
|
|
|
|
|
|
When I start my mdi application a new document always appears without pressing the new tab. Does anyone know how can I prevent this from happening?
Furthermore how can I make the application start in a maximized window??
Thanks.!
|
|
|
|
|
1°) Question
In the InitInstance():
....
// Parse command line for standard shell commands, DDE, file open
CCommandLine cmdInfo;
ParseCommandLine(cmdInfo);
......
.....
// DON'T display a new MDI child window during startup!!!
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing; /// This is
2°) Question
In the InitInstance():
Replace the line
pMainFrame->ShowWindow(m_nCmdShow); with pMainFrame->ShowWindow(SW_SHOWMAXIMIZED);
Too many plans make the health badly!!
|
|
|
|
|
Thanks very much
|
|
|
|
|
How to replace data parameter in a report with RDC...
Someone has some idea on like changing the parameters of a report to Runtime ??
Thanks in advance.
Too many plans make the health badly!!
|
|
|
|
|
Is it possible to build a C++ Windows Forms application using form designer in VS .NET 2003 and use it on a system which does not have .NET framework installed?
Thanks!
|
|
|
|
|
Ciprian Cana wrote: Is it possible to build a C++ Windows Forms application using form designer in VS .NET 2003 and use it on a system which does not have .NET framework installed?
No, it its not.
Windows Forms is the morale equivalent to the WIN32/MFC API in .NET.
You get the stuff behind the scenes only by installing the .NET Framework - which you are allowed to redistribute.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
I created a menu and accelerator keys but these(accelerator keys) are not working when I am operating thru key board.
please tell me the reason why? and how can I overcome the problem?
chakit
|
|
|
|
|
If your working within MFC, you have to make sure that your accelerator table ID matches that of your document resource id, the same way you have to for the menu and doducment description string
IDS_MYDOCTYPE, shoulf have an entry for string/menu and accelerator table.
If your working in a CDIaoog derived class I think you need to load the accelerator yourself and check to see whether it should be used yourself in an override of the PretranslateMessage using TranslateAccelerator fucntion.
If you vote me down, my score will only get lower
|
|
|
|
|
In the 16Bit days you could easily access the video ram B800:0000 with far pointers. "Far" is now obsolete since all pointers are 32Bit ones.
How can I access B800:0000 in a console application now ?
In 16Bit days this worked:
unsigned far int Videospeicher = 0xB8000000;
unsigned far int *pVideoPointer;
pVideoPointer = ( unsigned far int ) Videospeicher;
for( int i = 0; i < 20; i++)
{
*pVideoPointer++ = 0x4E41;
}
-- modified at 4:04 Friday 11th November, 2005
|
|
|
|
|
AFAIK, you can't. Windows is an OS with Virtual Memory support, which means that 0xB8000000 doesn't represent the physical memory at that address. What's more, if you try to read/write to that memory location, you'll get Access Violation errors because Windows detects that you're trying to use memory which has not been mapped.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Kamann wrote: In the 16Bit days you could easily access the video ram B800:0000 with far pointers.
One of my favorite parts of DOS programming was the ability to write directly to video memory.
Have you considered using the console API for this?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I wrote an entire UI library using direct video memory access. Exploding windows, SaveScreen/RestoreScreen, TextOut.. etc. Piece of cake and was it FAST!
onwards and upwards...
|
|
|
|
|
I want to hook the Calculator program anad want tok know which button is clicked. I tried to get the caption of button with GetWindowText function. it doesn't work for buttons. Also Spy++ Find Window utility does not find the captions of buttons, only it finds the class "Button".
why is it so? isnt there a way to know yhe caption of the button clicked?
please help me.
Elif (Erkul) Ceylan
|
|
|
|
|
You will probably find that these buttons do not have any caption text associated with them as they are bitmap buttons.
If you need to work out which buttons are being pressed, use the button ctrl Id, (GetDlgCtrlId())
If you vote me down, my score will only get lower
|
|
|
|
|
Merhaba Elif Hanim,
Niye buttonun captionunu alamadiginizi anlamadim. Mesajiniz post edileli bayagi olmus ama asagidaki kod calisiyor. Umarim hala isinize yarar:
void CTrialView::OnBnClickedButton1()
{
CString szString;
CButton *pButton;
pButton = (CButton*)GetDlgItem(IDC_BUTTON1);
pButton->GetWindowText(szString);
AfxMessageBox(szString);
}
Hakan YAMANYAR
|
|
|
|
|
Hi everybody,
I'm building a program that catch messages from keyboard and mouse, like Spy++ in VC++ (The program is a dialog-based program using Hook technique). I've encoutered a problem that I can't get messages if working outside my application's window. It means if I do anything outside my application dialog, I can't catch the messages. Can anyone tell me how to get windows handler so that I can catch messages from other applications'widows running at the same time with my application? Thank you very much!
Best regards!
|
|
|
|
|
0212319 wrote: I've encoutered a problem that I can't get messages if working outside my application's window. It means if I do anything outside my application dialog, I can't catch the messages.
For Catching Window Message of Other Message you have to create global hook dll :-
here is an example:-
http://codeproject.com/dll/hooks.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
In addition to Alok's suggestion, you might also look into SetCapture() .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|