|
Thanks a lot guys
|
|
|
|
|
I use a image as CRichEditCtrl's background.
but when I input some words,the background was break by the character.
how to deal wiht it?
|
|
|
|
|
Hi
what's the easiest way to make my popup-menu transparent?
I would like to use SetLayeredWindowAttributes, and I know how to use it...but where and when do I need to use it? and how can I get the HWND of my popup-menu?
thanks in advance
modified 12-Sep-18 21:01pm.
|
|
|
|
|
How do I set the title bar text on a dialog application...I used to know, and now I have forgotten something as simple as that.
SetTitle doesnt seem to work. I want it so if I click on a button it will set the window text to what I specify!
Thanks
Ashman
|
|
|
|
|
What about SetWindowText?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Or to be more specific.
SetWindowText (hDlg, _T ("Test me now baby"));
Or if you are using MFC:
dlg .SetWindowText (_T ("X"));
or
SetWindowText (_T ("X")); if you are invoking SWT from an instance of the class.
Tim Smith
Descartes Systems Sciences, Inc.
|
|
|
|
|
Hi all,
Can CDaoDatabase object return LPUNKNOWN value ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Which files should I add to my installshield
when I write database program?Should I install
SQL Server (or MS Access)on the computer I want to use my application?
|
|
|
|
|
Install MDAC 2.7
That'll install all the required ADO DLLs and ODBC stuff and DAO and whatever
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
If you are using the developer edition of InstallShield, It includes support for the merge modules. You can just select the MDAC merge module in the corresponding option, and install shield takes care of the rest. The downside is your installation increases in size.
Cheers
Kannan
|
|
|
|
|
Hi Folks,
I am trying to print a captured screen. In one of the previous posts, it was suggested that a screen can be captured very easily using the code attached below.
The code returns a handle to the screen. Does anyone know if and how we can use this handle to print the screen to the printer.
Any help is greatly appreciated.
Thanks.
Gautam
code for capturing screen: -
HDC hdcSrc,hdcMem;
int cx,cy;
HBITMAP hBitMap;
HWND hwnd;
//Get Desktop Handler
hwnd = ::GetDesktopWindow();
hdcSrc = ::GetDCEx(hwnd,NULL,NULL);
hdcMem = CreateCompatibleDC(hdcSrc);
cx = GetSystemMetrics(SM_CXSCREEN);
cy = GetSystemMetrics(SM_CYSCREEN);
hBitMap = CreateCompatibleBitmap(hdcSrc,cx,cy);
SelectObject(hdcMem,hBitMap);
BitBlt(hdcMem,0,0,bitmap->bmWidth,bitmap->bmHeight,hdcSrc,0,0,SRCCOPY);
DeleteDC(hdcMem);
::ReleaseDC(hwnd,hdcSrc);
|
|
|
|
|
This might be an easier method
use keybd_event with VK_PRINTSCREEN
that'll copy it into the clipboard
now all you need to do is figure out a way to send the clipboard to the printer
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
If you don't find me on CP, I'll be at Bob's HungOut
|
|
|
|
|
Try to get an HDC to the printer and call StretchBlt passing it the HDC and the handle to the bitmap. The other args will define the size you want to display the image.
|
|
|
|
|
Ive seen some pretty good things, like web addresses automaticall turning into hyperlinks using these classes, but i dont have the slitest idea how to use them, all i know is that i need to derive from CRicheditView.
PLEASE PLEASE PLEASE htlp me if you can.
Thanks.
==================================================
The Eclypse
|
|
|
|
|
Use riched20.dll. Send the rich edit control the message EM_AUTOURLDETECT. Whenever the user clicks on a link a WM_NOTIFY message will be sent. The notification is EN_LINK. lParam is a pointer to a ENLINK structure containing information about the link.
I'm not familiar with MFC's implimentation (ON_NOTIFY(EN_LINK, OnLinkNotification) or something). I hope that helps though.
|
|
|
|
|
Hi,
I am working on an encryption program. There are two versions. One is text encryption and the second is binary encrytion. The text encryption is fairly simply. The downside to the text version is that is only works on text files. One the other hand, I cannot get the binary encryption program to work.
There are two problems. First, I cannot copy complete raw data from any file and save it into a character array. I have tried giving the array a specific size and I have tried dynamically allocating the size of the array based on the size of the ifstream.
ifstream openFile;
openFile.open(x, ios::in | ios::binary);
openFile.seekg(0, ios::end);
size = openFile.tellg();
char *temp;
temp = new char(size);
openFile.read((char *) temp, sizeof(temp));
The code above does work, however, "sizeof(temp)" always output a 4 even if its subscript is 1000. the char * does not affect it because I saw the same number even if I use:
char temp[100];
How do you read raw data (binary) from any file and save it in memory so you can make specific encryption and then write it back in binary mode?
Thanks,
Kuphryn
|
|
|
|
|
If it is not tooooo much trouble, I would like to know how to do text encrypting.
==================================================
The Eclypse
|
|
|
|
|
Instead of
char *temp;
temp = new char(size);
openFile.read((char *) temp, sizeof(temp));
use
char *temp;
temp = new char(size);
openFile.read(temp, size);
sizeof(temp) is always going to return 4 because it's a pointer. There's actually no way to say "how many bytes is there allocated for this pointer", so you just have to remember it for yourself...
kuphryn wrote:
How do you read raw data (binary) from any file and save it in memory so you can make specific encryption and then write it back in binary mode?
I always use fread() and fwrite() for that
Just open the file as binary, and put it in a buffer with fread()
Here is a simple function that writes a binary file...
bool SaveBinaryFile(const char *filename, const char *buffer, const int buflen)
{
FILE *f = fopen(filename, "wb");
if (f == NULL) return false;
unsigned int i = fwrite(buffer, sizeof(char), buflen, f);
fclose(f);
if ((signed)i != buflen) return false;
return true;
}
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Thanks everyone.
Hey Anders,
fread() and fwrite() functions new to me. Are those functions C++ or C?
Kuphryn
|
|
|
|
|
kuphryn wrote:
fread() and fwrite() functions new to me. Are those functions C++ or C?
C, not C++
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Oh. Okay. Thanks.
Kuphryn
|
|
|
|
|
You can use _fstat() to get the size of the file. This is faster than seeking to EOF.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I'm looking for a way to set a user configurable font to my controls. I'm fine with the Windows default fonts, but our application uses a list control and is commonly displayed on an overhead projection screen and the default font is too small. I'd like to be able to provide a "Use Bold" or maybe just a standard font dialog and allow a user to select which font will be used application wide.
It looks like Microsoft took out the ability to configure a default system font in Win2K and XP, so I'm not going to get to take the easy way out this time :/
One thing I've tried is to enumerate all of the controls on a dialog or window and call SetFont() but entry fields and date/time pickers will display things erroneously and the selection caret is off.
I'm assuming there has to be a better way without having to owner draw every control.
Any help is appreciated.
|
|
|
|
|
thanks Carlos that helped me out a lot
but now i have the following problem, i am trying to put one function in the dll that handles some opengl animation code so i can call it from another application which uses opengl BUT! first of all i need to include Gl.h to acces the functions but i also need to link to the opengl .lib file, but when i go to project settings under the dll project the tab for linking is gone. What does this mean??? can't i put the function in my dll? or do i need to manually import something or what?
Kuniva
|
|
|
|
|
Hello, I have a CView class, and I want to know when it is maximized, minimized or closed. Can anyone tell me how to catch these messages. Thanks
|
|
|
|