|
|
ok then what is difference between subclass and ownerdarw
|
|
|
|
|
maybe a precision, subclassing was mostly used in Win32 to help ownerdraw a control, but with MFC you can either subclass a control or derive from a control.
you csn subclass a control without having the need to ownerdraw it (for example change the behaviour without changing the look).
(I'm probably wrong, but ...) You need to subclass (or derive) to be able to Ownerdraw a control.
M.Watched code never compiles.
|
|
|
|
|
To subclass a window means to add the ability to intercept windows messages for a standard window or control and add some custom behaviour to it. Ownerdrawing is a facility provided by certain controls where the control itself calls back to a user function which performs the actual paint functionality. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
|
how to Arrange/sort rectangle control buttons according to size or name in a dialog based application please help me I have 10 buttons created dynamically in a dailog with different sizes.how to arrange them according to the sizes and according to name.When application is running
It is needed to create buttons dynamically.
-- Modified Friday, February 19, 2010 5:58 AM
|
|
|
|
|
Do you really need to create controls dynamically?!
However, take a look at MoveWindow()[^], SetWindowPos()[^], etc., to move your controls at runtime.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Hi All,
I have developed one Add ons for Internet explorer. Now I want to add Publisher name for add ones. When you will click on Tools->manage Add ons on IE, You will see list of publisher name like Google , yahoo for there ad ons.I want to add such publisher name for add ons.Is it related to code signing of application? plz send me some hint....
Thanks
abm
|
|
|
|
|
|
Hi all,
i sending sms from my mobile with the help of At commands.
its working fine.
i have one problem,firstly i m sending normal sms from application,than i m using AT+CSMP command to send flash sms from mobile.
when i again start the application and start to send sms, all message are set in flash format.
i dont know can i send sms again in normal message again.
please help me how can i remove flash sms format here,
thanks in advance.
|
|
|
|
|
This is what my documentation says for this command:
3.3.2 Set Text Mode Parameters +CSMP
Parameter Command Syntax
Command Possible response(s)
+CSMP=[<fo>[,<vp>[,<pid>[,<dcs>]]]]
+CSMP? +CSMP: <fo>,<vp>,<pid>,<dcs>
+CSMP=?
Description
Set command is used to select values for additional parameters needed when SM is sent to the network or placed in a
storage when text format message mode is selected. It is possible to set the validity period starting from when the SM is
received by the SMSC (<vp> is in range 0... 255) or define the absolute time of the validity period termination (<vp>
is a string). The format of <vp> is given by <fo>. If TA supports the EVPF, see 3GPP TS 23.040 [3], it shall be given
as a hexadecimal coded string (refer e.g. <pdu>) with double quotes.
NOTE: When storing a SMS-DELIVER from the TE to the preferred memory storage in text mode (refer
command Write Message to Memory +CMGW), <vp> field can be used for <scts>.
Are you sure its the one you need to be using? Morality is indistinguishable from social proscription
|
|
|
|
|
Hi all,
I am trying to update VS_VERSION info of my application using this code
VS_VERSIONINFO *pVerInfo;
LPBYTE pOffsetBytes;
VS_FIXEDFILEINFO *pFixedInfo;
LPCTSTR lpszFile = _T("C:\\a.exe");
DWORD dwHandle,
dwSize,
dwResult = 0;
dwSize = GetFileVersionInfoSize(lpszFile, &dwHandle);
if (0 < dwSize)
{
LPBYTE lpBuffer = new BYTE[dwSize];
if (GetFileVersionInfo(lpszFile, 0, dwSize, lpBuffer) != FALSE)
{
#define roundoffs(a,b,r) (((BYTE *) (b) - (BYTE *) (a) + ((r) - 1)) & ~((r) - 1))
#define roundpos(a,b,r) (((BYTE *) (a)) + roundoffs(a,b,r))
pVerInfo = (VS_VERSIONINFO *) lpBuffer;
pOffsetBytes = (BYTE *) &pVerInfo->szKey[_tcslen(pVerInfo->szKey) + 1];
pFixedInfo = (VS_FIXEDFILEINFO *) roundpos(pVerInfo, pOffsetBytes, 4);
pFixedInfo->dwFileVersionMS = 0x11112222;
pFixedInfo->dwFileVersionLS = 0x33334444;
pFixedInfo->dwProductVersionMS = 0x00030010;
pFixedInfo->dwProductVersionLS = 0x00000031;
HANDLE hResource = BeginUpdateResource(lpszFile, FALSE);
if (NULL != hResource)
{
UINT uTemp;
if (VerQueryValue(lpBuffer, _T("\\StringFileInfo\\ProductName"),(LPVOID *) &lpTranslate, &uTemp) != FALSE)
{
if (UpdateResource(hResource, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO), lpTranslate->wLanguage, lpBuffer, dwSize) != FALSE)
{
if (EndUpdateResource(hResource, FALSE) == FALSE)
dwResult = GetLastError();
}
else
dwResult = GetLastError();
}
}
else
dwResult = GetLastError();
}
else
dwResult = GetLastError();
delete [] lpBuffer;
}
else
dwResult = GetLastError();
if (0 != dwResult)
wprintf(_T("Operation was not successful. Result = %lu\n"), dwResult);
else
wprintf(_T("Operation was successful."));
but my problem is that code is updating the files version info but not product info..
Can anybody what i am doing wrong or what i am missing..
thanks in advance
|
|
|
|
|
Hi friends
I am using CDatabase class to open Access database in my program. Sometimes it shows an error "Specified driver could not be loaded due to system error 1114 (MICROSOFT ACCESS DRIVER (*.mdb))". How can i resolve this problem
thanks in advance-kk.tvm-
|
|
|
|
|
i thinks its come from u r not disposing the db object .not exactly ..
could u write your ConnectionString ... Failure is Success If we learn from it!!
|
|
|
|
|
Hi
Connection string as follows
m_strDBConnect = "ODBC;DRIVER={MICROSOFT ACCESS DRIVER (*.mdb)};DSN='';DBQ=c:\abc.mdb"
thanks in advance-kk.tvm-
|
|
|
|
|
i dont know ..why that error comes ..any way u
try this ..
CDatabase dbStar;
CString strConnection = _T("Driver={Microsoft Access Driver (*.mdb)};Dbq=D:\\Sample.MDB;Uid=;Pwd=;");
if ( dbStar.Open(_T(""),false,true,strConnection,true))
{
}
and tell me the result ...? Failure is Success If we learn from it!!
|
|
|
|
|
Is there any way to run a MDI/SDI MFC application in silent mode and pass some files to it?
Best,
MJM
|
|
|
|
|
Yes, they're called command-line arguments."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
If I understand you correctly, in your app class' InitInstance() you would check if the program was given any command line arguments. If so, instead of your normal processing, you would pass these arguments to a function to do the work and then return FALSE.
I am concerned that it is a bad idea as it gives the user no feedback and is left to wonder if the program is running, has finished, or something went wrong & never ran.
Hopefully, I have misunderstood you and you want something else.Please do not read this signature.
|
|
|
|
|
Avi Berger wrote: I am concerned that it is a bad idea as it gives the user no feedback and is left to wonder if the program is running, has finished, or something went wrong & never ran.
If it's documented, then why not ?
I could find a few GUI software that I use that simply do reporting but need to load them, press file open, click on a few options ans save-sa ... if I could simply call them with command line options that would speed up some tasks.Watched code never compiles.
|
|
|
|
|
I would agree that some things would be more effective with a command line entry. GUIs are popular, habit forming, and not necessarily the best way to get things done.
My concern is in my (perhaps wrong) interpretation of silent as totally silent. From a console you at least get the feedback of the next command prompt without a "command not found" error to let you know something was done and completed. A "somefile processed" message as well would be nice if provided.
I have had some occasion to do general end-user support. When responding I was imagining how some people I have dealt with would react to this. In a GUI environment, they would expect a visual response to their action and would not check documentation for this. I was seeing one of them in my mind double clicking on an icon - nothing happens. (A shortcut can be set up to include command line params) Repeat several times. Call for help, "This software doesn't work". This is exactly how several people I've dealt with would react.
Actually, I would want some feedback myself to know that the task was completed. Something could have gone wrong or I might have made an entry error. Let me try to improve my response as follows:
This can be a useful, good idea in the right circumstances, but consider being automatic, but not totally silent. Consider providing a progress indicator display or an "I did it" dialog. The dialog can even be self closing after a time-out.
Anyway, that's my thoughts. Make any sense?Please do not read this signature.
|
|
|
|
|
Let me hook in...
I'll surely understand your point and agree with you, but also consider the possibility that there's no user behind! In my company, busy with machine to machine communication, it is deadly if a piece of code would raise a dialog like 'Work is done press Ok'. Nowadays people tend to think that computers are not of any use if there's no user behind....
The best way to do it (i think): create a interactive and a unattende mode for your program, the interactive mode with user-feedback, the unattended mode with logging feedback...
|
|
|
|
|
I'll agree with your point in turn. Since he was talking about what was a GUI program in the first place, I was assuming this was an environment with a user initiating the execution. If this is actually for unattended operation, as you say, my concern is misplaced.
By the way, I don't think of computers only in terms of having a direct human user. I also work on computers with no user, keyboard, or display.Please do not read this signature.
|
|
|
|
|
I am trying to pass in a vector of some subclass to a function defined with the base class in the parameter list, like void mod(vector < baseclass > &bcs). If I have a vector of subclass objects, as vector < subclass > sc, and call mod(sc), I get the error "A reference that is not to 'const' cannot be bound to a non-lvalue". Doing this without vectors is no problem; i.e, void mod(baseclass &bc), subclass sc; call mod(sc). I can get around this by defining 2 sum(*) functions, one with a baseclass parameter and one with a subclass parameter, but there goes the use of inheritance. The vector will by modified by mod(*), so I don't want to pass as const. Is there a way I can use 1 function on both the base and sub classes? Thanks.
|
|
|
|
|
OK, I haven't done C++ for 5 years but here are some thoughts (which may be wrong but may suggest some ideas)
1. Does C++ allow vector<subclass> to be substituted for vector<baseclass> in the first place (template covariance)?
2. If it does then try void mod(const vector<baseclass> &bcs) as your function signature. (Parameters should be const-qualified anyway.)Kevin
|
|
|
|