|
|
I've searched around a bit for window class names and found the function GetClassName . This function seems to get the class name directly (your function doesn't do anything other, or?). Any reason not to use this function?
Thanks for your replies and best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
|
|
Hello!! Me again!
I want to ask who got a example of how to write a void member function data (integer) into disk file or write a group of integer into disk file ??
thank you!!
|
|
|
|
|
Anonymous wrote:
...who got a example of how to write a void member function data (integer) into disk file...
Not sure what you mean by this.
Anonymous wrote:
...write a group of integer into disk file ??
Easy enough:
CFile file(...);
for (int x = 0; x < 10; x++)
file.Write(&x, sizeof(int));
file.Close(); or
CStdioFile file(...);
for (int x = 0; x < 10; x++)
{
CString str;
str.Format("%d\n", x);
file.WriteString(str);
}
file.Close();
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I has an application that can has mamy type of files (word, pdf, ppt, xls,text , htm, jpg, tif and so on )
i as to print those file by rigth click and click print.
i use ShellExecuteEx for this. but i also has to show user printer dialog so that he can select printer and can choose other setting.
please suggest any solution.
my second problem is that.
to solve the above problem i use DoPrintDialog to show the dialog and threw devmode struct try to set printer properties
i use following functions
OpenPrinter
GetPrinter
SetPrinter
these function work i the use is Admin.
but fails in case of restricted user
does anyone has solution to this problem or any other solution for this problem.
Kindly help
Sudhir Mangla
http://Programmerworld.net
(Free books , articles , Source Code and Programming Tools and Utilities)
|
|
|
|
|
Hi,
To show the printer Dialog, you can use CPrintDialog class with appropriate values in the constructor.
May be this will help u, if u use mfc.
Find the job u love and u never have to work for a day in ur life.
|
|
|
|
|
i do this but my problem is that I don't has enough rigth when i login as general user to call setprinter
Sudhir Mangla
http://Programmerworld.net
(Free books , articles , Source Code and Programming Tools and Utilities)
|
|
|
|
|
I am used to create objects in MFC by draging icons and connect to MessageMap by suing Class Wizard.
Now I want to create CButton object dynamically as when I type "20" in a Edit then click a button to create 20 buttons in my dialog.
But....how(where) do I put the point of these 20 buttons ?
And ..
If I've created these 20 buttons, how do I connect these buttons to Message Map ?
I have no idea about these question ...
Gave me a hand , please ....
|
|
|
|
|
Hi,
U can use the following method to create the buttons dynamically. In the following statement "but" is the CButton object which is declared as public class variable.
if(!but.Create("click me",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,CRect(10,10,100,30),this,ID_MYBUTTON))
AfxMessageBox("Button Not Created");
else
AfxMessageBox("Button Created");
The argument ID_MYBUTTON is a macro and should be replaced with some integer values like below.
#define ID_MYBUTTON 100
Then the message handling mechanism. First declare the member function in the class like as below.
void MyMessage();
In the message map macro add the following step. This should be in the message map of the class in which u r going to create the button.
ON_BN_CLICKED(ID_MYBUTTON,MyMessage)
and define the function, i.e., MyMessage().
finally make sure that, ur member function and data members are displayed in the class view.
Hit the execution icon, and check the result.
Hope this will be little drilling for the people who doesn't have much knowledge about mfc and its message hook mechanism.
Let me know if u have more doubts.
thanks,
Zxczc
|
|
|
|
|
Hello ,Zxczc
Thank you for your reply
I think I forgot to express an important factor.
Before I input a number in the Edit and click the create Button ,the AP doesn't know how many Button it need to create.
I don't have a good sense, so that it is what I mean "dynamically".
Dose it possible to do?
Or I must to decide the maximum number of the button in source code, then hide the useless button?
Is that the only way ? or there is another better method?
Thank you
|
|
|
|
|
xo3000 wrote:
Dose it possible to do?
Sure it is possible!
But you are very much on your own here, without the Wizard and the MFC macros.
MFC may good enough for your little sister, but Win32 is for real men, you know?
Create the Buttons you need, and catch their BN_CLICKED notification.
That is done by overriding PreTranslateMessage and waiting for a WM_COMMAND message with a HIWORD(wParam) being BN_CLICKED .
The LOWORD(wParam) is the identifier (the last number of the CREATE -statement) and the lParam the buttons handle.
Now you have full control over the button.
"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've been trying to do a simple program like the one on this site about toggling the proxy settings. The problem is when i try to compile I get this error.
Form1.obj : error LNK2001: unresolved external symbol "int __stdcall InternetQueryOptionA(void *,unsigned long,void *,unsigned long *)" (?InternetQueryOptionA@@$$J216YGHPAXK0PAK@Z)
I can't seem to crack where the problem is. I have this includes
#include <iostream>
#include <string>
using namespace std;
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
#include <wininet.h>
#include <urlmon.h>
#include <stdio.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include "strsafe.h"
#include <stdlib.h>
#define INET_ERR_OUT_MSG_BOX_BUFFER_SIZE 512
#define INET_ERR_OUT_FORMAT_BUFFER_SIZE 256
#ifdef _UNICODE
#define _itot _itow
#else
#define _itot _itoa
#endif
#using <mscorlib.dll>
using namespace System;
using namespace System::Security::Permissions;
using namespace Microsoft::Win32;
AND THIS LITTLE CODE:
InternetQueryOption(NULL,INTERNET_OPTION_USER_AGENT,NULL,&dwSize);
char *lpszData;
lpszData = new char[dwSize];
InternetQueryOption(NULL, INTERNET_OPTION_USER_AGENT,lpszData,&dwSize);
delete [] lpszData;
at first it did not have the char *lpszData; because in the Microsoft page didn't have it and I got undeclare variable.
Any thoughts...
Kamui
|
|
|
|
|
|
I'm sorry, but where in that page says something about. wininet... I can't seem to find it.
Kamui
|
|
|
|
|
Linking error are arises due to the fact that linker can't find the actual defination of function at linking time.
as Internet...(...) related Api are defined in WinInet.lib, so thats why i ask you to include that in your project.
[Vote One Here, Complete my Survey....]
Alok Gupta visit me at http://www.thisisalok.tk
"I Think Believe this Will Help"
|
|
|
|
|
Alok, that did it!!!!! Sorry I didn't reply sooner but I live in Japan and with the time diference I had to go.
But Thank you very much.
Kamui
|
|
|
|
|
|
for a point of sale software, we uses the dot matrix printer for printing, so we need the printer commands for skipping, rollbacking paper etc....any idea ?
thanks in advance
Ninety-eight percent of the thrill comes from knowing that the thing you designed works, and works almost the way you expected it would. If that happens, part of you is in that machine.
|
|
|
|
|
These commands almost ALWAYS absolutely vary by printer (or at least by manufacturer), and involve sending escape sequences to the printer to tell it to do such things.
You can communicate with printer in RAW data format mode, but you will still need to write an interface layer to send it the proper escape sequences. There is no special 'built in' windows commands I am ever aware of to tell printer to do such things. I think there is an article here on CodePrject about writing to printer in the RAW mode.
|
|
|
|
|
thanks,
i am using the EPSON printer ( atleast they have the same escape sequences ? )
Ninety-eight percent of the thrill comes from knowing that the thing you designed works, and works almost the way you expected it would. If that happens, part of you is in that machine.
|
|
|
|
|
Could someone help to explain what the two line statements below mean? Thanks,
int (*read_byte)(struct pci_controller*, pci_dev_t, int where, u8 *);
void (*fixup_irq)(struct pci_controller *, pci_dev_t);
|
|
|
|
|
|
Thanks,
WEll, I still cannot understand whys
Question 1. Why use "viod" here, this is not a "method" definition?
Question 2. Why use cast method here like "(*fixup_irq)"?
(I got these codes from linux.)
void (*fixup_irq)(struct pci_controller *, pci_dev_t);
|
|
|
|