|
rcraigadams wrote:
devMode.dmDefaultSource = this->tray; /* number between 1 and 15 */
From where you getting this->tray... have you make a call to DeviceCapabilities ( which reterive capabilities of printer device)
"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
|
|
|
|
|
Hi All,
I'm really baffled and having struggled for several days, I need to bare my soul and ask for help
With C++ VS 6, I have created a COM component, added an ATL (Full Control), added methods and events to the appropriate interfaces and then created a modeless dialog (CDialog) in the component. The control has no CWnd so when I create the modeless dialog, I use Create (IDD,NULL) where the NULL indicates, I think, that the parent is the main app window, of which there is none, at least not in the COM component itself.
Things all work well so far and I have added a bunch of standard dialog controls, buttons, statics, edit controls, etc all working fine EXCEPT I am unable to use the TAB key to move between edit controls. In general, it seems that mouse messages are sent to the dialog where I can handle them but most keyboard messages (WM_CHAR, WM_KEYDOWN, WM_KEYUP, etc. are not. In fact, I even added a PreTranslateMessage handler to the dialog, but it never even gets called?
In desperation, I added a PreTranslateMessage handler to the "MFC host app" that instantiates and uses the COM component and indeed I can capture the messages of interest from the CDialog in the COM component, WM_CHAR, WM_KEYDOWN, WM_KEYUP, etc but of course it doesn't do me much good to have the messages at this high level. My guess is that the messages get to the MFC host app because, to a COM component, the host app "is" the main application window??
Either way, I really need to have the dialog in the COM component allow the user to tab between edit controls. Any help would be greatly appreciated.
Thanks,
Doug
Doug Knudson
|
|
|
|
|
Sir i want to insert more than one checkbox for
mutiple selection in menu.I have tried ON_UPDATE_COMMAND_UI,we could perform only one selection
form many menu item, Sir could u please help
me to how to insert any controls(CheckBox,radio,spin)as
menu items.
Satish varma.E
|
|
|
|
|
I don't think I have seen such stuff before.
You could create a modeless child dialog with custom controls and so on, and show it when the menu header is clicked, and at the right place, and handle the problem of the whole dialog losing focus, and hiding it yourself. It would look cool with all the controls, but it is a difficult lengthy task.
this is this.
|
|
|
|
|
Hi all:
I tried to sort out creating a bmp file and save an image in C++. It really annoyed me. Following is my test code, but it doesn't work. Could somebody give me an idea how to create a bmp file and store an image please????
Thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
void draw(){
int x[100];
int n = 0;
for(int i = 0; i < 10; i ++){
for (int j = 0; j < 10; j ++){
x[i*10+j] = n++;
if (n >= 255) n = 0;
}
}
HBITMAP map = CreateBitmap(10, 10, 1, 8, x);
if (map == NULL) cout << "cao ni ma\n";
HANDLE hf; // file handle
BITMAPFILEHEADER hdr; // bitmap file-header
BITMAPINFOHEADER bih; // bitmap info-header
LPCTSTR filename = "output.bmp";
DWORD dwTmp;
hdr.bfSize = sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER)+sizeof(x);
hdr.bfReserved1 = 0;
hdr.bfReserved2 = 0;
hdr.bfType = 0x4d42;
hdr.bfOffBits = sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER);
bih.biSize = sizeof(BITMAPINFOHEADER);
bih.biWidth = 100;
bih.biHeight = 100;
bih.biPlanes = 1;
bih.biBitCount = 8;
bih.biCompression = BI_RGB;
bih.biSizeImage = 0;
bih.biXPelsPerMeter = 0;
bih.biYPelsPerMeter = 0;
bih.biClrUsed = 0;
bih.biClrImportant = 0;
hf = CreateFile(filename,
GENERIC_READ | GENERIC_WRITE,
(DWORD) 0,
NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
(HANDLE) NULL);
WriteFile(hf, &hdr, sizeof(BITMAPFILEHEADER),(LPDWORD) &dwTmp, NULL);
WriteFile(hf, &bih, sizeof(BITMAPINFOHEADER), (LPDWORD) &dwTmp, NULL);
WriteFile(hf, (LPSTR) x, 100, (LPDWORD) &dwTmp, NULL);
}
Asura
|
|
|
|
|
Hello Luo ming,
Take a look at "programing windows", there is intensive discussion about bitmap
stuff.
Good luck!
|
|
|
|
|
Ming Luo wrote: WriteFile(hf, (LPSTR) x, 100, (LPDWORD) &dwTmp, NULL);
for starters, for a 100x100 RGB image, you need to write 300 bytes worth of pixel data per each pixel row. looks like you're only writing 100 bytes total.
Cleek | Image Toolkits | Thumbnail maker
|
|
|
|
|
hi , plz help me to read seralnumber harddisk or read sazi darddisk
or read serialnumber mainbord
tnx for help me
nader
|
|
|
|
|
|
kakan wrote: Use GetVolumeInformation(). See here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/fs/getvolumeinformation.asp[^]
Hai Kakan,
Sorry for trouble, little correction buddy.. that api return the Volume Serial Number not the Hardisk or Motherboard..
"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
|
|
|
|
|
Hello Alok. You are right (of course).
|
|
|
|
|
yasa294 wrote: hi , plz help me to read seralnumber harddisk or read sazi darddisk
or read serialnumber mainbord
tnx for help me
look at this :-
Computer System Hardware Classes [WMI][^]
"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
|
|
|
|
|
I would like to check the status of a specific Windows service, that is, I want to programatically check whether a specific windows service is running currently or not.
I would like to know the Win32 API function to accomplish this because I would like to use it in LotusScript. LotusScript uses Win32 API function similar to the VB where you can DECLARE Win32 API function & arguments and call the function in the code.
Thanks in advance
|
|
|
|
|
amigo_rk wrote: I would like to check the status of a specific Windows service, that is, I want to programatically check whether a specific windows service is running currently or not.
SC_HANDLE hSCM = OpenSCManager("SERVER", NULL, SC_MANAGER_CONNECT);
SC_HANDLE hService = OpenService(hSCM, "NameOfService", SERVICE_QUERY_STATUS);
SERVICE_STATUS ss;
QueryServiceStatus(hService, &ss);
CloseServiceHandle(hService);
CloseServiceHandle(hSCM);
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
amigo_rk wrote: I would like to know the Win32 API function to accomplish this because I would like to use it in LotusScript. LotusScript uses Win32 API function similar to the VB where you can DECLARE Win32 API function & arguments and call the function in the code
List of api related to service :-
http://www.codeproject.com/system/AMFSServiceManager.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
|
|
|
|
|
I have an application that prints Names.
Extended characters are being discarded in the printing. (I.e. À Á Â Ã Ä Å Æ Ç È É Ê Ë).
I am using TextOut() to send the text to the printer. I have tried alternate fonts, alternate charactersets in the font, but nothing seems to change.
The printed text for the above string is always (in different fonts) A A A ? A ? ? C E E E E.
What am I doing wrong? What can I do differently?
Thanks,
Craig
|
|
|
|
|
Hi..
On my Tabcontrol Application,there are some n number of edit boxes(all are created dynamically)..
Now when i am outside the editboxes & press the "End" Button the control will shift to the end of that dialog..Similarly when i am at the end of the dialog and if i press the "Home" button the control should go to top of the dialog..This all is working fine..
I had used the following code which i kept it in the PreTranslateMessage()
if(lpMsg->message == WM_KEYUP && lpMsg->wParam == VK_END)
{
HWND hWnd;
hWnd = this->m_hWnd;
DWORD nPos = ::GetScrollPos (hWnd, SB_VERT);
nPos <<= 16;
DWORD nScrollCode = SB_TOP;
WPARAM wparam = nPos | nScrollCode;
::SendMessage(hWnd,WM_VSCROLL, wparam, 0);
return TRUE;
}
But the Problem is that when the control is in Edit Box & if i press the "End" button the control goes to the end of the text in the edit box and then it goes to end of the dialog which should not happen(the control should go to the end of text in edit box & not to end of dialog)...
i.e when the control is in edit box,the default functionality of "End" button should take place..How can i achieve this?????????
Plz Help ME!!!!
Thanks in Advance....
|
|
|
|
|
I think deriving a class from CEdit and making children of your derived CEdit: CMyEdit should do it. That way you could even ignore some keys if you wanted to, or perform some special action with some keys.
In short, I think you need to do some subclassing of the CEdit control.
this is this.
|
|
|
|
|
I have crated two dlls which contanins
some functions usefull in my application.
I need to include the "lib" file so i do it
from
>Project>Setting >Link>Object/library modules
i just add the name of my dll
dll5.lib
it works fine for fist dll
now i have another lib to include ,it gives me
error
Can anyone tell me the exact way to include the lib file
thank you
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Usually if you have the libraries in the same solution file; simply making the application dependant on those libraries automatically links with their LIB files. Right click on your application in the solution browser and choose 'Project Dependencies' - tick the boxes for your two DLL projects. That should get the linker working.
If, however, your libraries aren't in the same solution (and I recommend they are!), then you'll need to add both the 'lib' file as you describe but also you'll need to add paths to the places where the two LIBs are stored in the Project>Setting>Link>General>Addition Library Directories. Be sure to path the 'Debug' lib in debug and the 'Release' lib in release (or whatever's appropriate).
As you can see; it's a lot easier if you can make the application project dependant on the libs in the solution, as then .NET will automatically ensure the relevant lib file is linked.
Matt Godbolt
Engineer, ProFactor Software
StyleManager project
|
|
|
|
|
Thanks for ur reply
I will try this things first ,
but i am using the VC.6 and not .Net
anyway thanks
vikas
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
|
vikas amin wrote: I will try this things first ,
What about using #pragma directive to include lib file...
e.g.
#pragma comment(lib,"abc.lib")
"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
|
|
|
|
|
|
I am a bit confused by the Performance monitor: I want to check a process for large-scale leak allocations. "Virtual Bytes" sounds like the best idea to monitor. Comments?
We say "get a life" to each other, disappointed or jokingly. What we forget, though, is that this is possibly the most destructive advice you can give to a geek.
boost your code || Fold With Us! || sighist
|
|
|
|
|