|
Forget about 'expiring' if you're trying to protect your shareware app. Cracker d00dz will be able to break it very easily.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Hello all.
I'm now creating a ActiveX control using mfc ActiveX control wizard.This control draws lines and arcs defined. Can I export my classes in this project? how? Thank u for any suggestion!
Best Regards
Denkor
|
|
|
|
|
I know that it provides IHTMLEventObj for access event process.
But I don't know how it acknowledge me when event occured.
|
|
|
|
|
can a variable be inserted into a structure(declared in some header file and containing some variables) during run-time? If yes, how?
|
|
|
|
|
I doubt it. You're asking an application to change the size of a class within itself. That's a big change.
Why would you want to ?
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Do you mean a self-growing array like std::vector()?
You can't change the declaration you gave to your compiler, this is compile-time.
But you can declare 'here is a pointer to any amount of memory'.
Strings do this all the time.
Or you can declare 'here are any number of XY objects': this would be a std::vector.
I hope this helped
|
|
|
|
|
When IE connect to a website using SSL,IE will display a dialog to ask user to select a certificate of him(or her).
In fact,IE connect to the system's CSP and search user's certificate.
my question is:
if my certificate is stored in other place,but not in the system's CSP or a SmartCard,how can I have IE use my certificate when it connect to a SSL website?
For example,I store my certificate(and private key) in my own USB card,which is not compatible with the SmartCard.What can I do?
I think that if I can hold up the event which occur when IE connect to the system CSP for requiring a user certificate(and private key),it will be simple!
thanks advance!
|
|
|
|
|
Hi I had a structure which looks like this:
1.
struct CMyStruct
{
5-6 CString ...;
int ...;
long ...;
1 CStringArray ...;
};
2.
My application is going to generate a lot of instances of CMyStruct; I therefore thought it to be a good idea to use the CArray MFC template class to *manage* my structs. (Adding, deleting etc.)
3.
Accordingly, I put the following definition in my dialog header file.
#include <afxtempl.h>
#include <Mystruct header file>
CArray<CMyStruct,CMyStruct&>MyStructArray;
4. After this I began using it in the following manner:
CMyStruct myStruct;
PopulateMyStruct(&myStruct);//Structure populated
MyStructArray.Add(myStruct);//ERROR PRODUCING LINE
5. On compilation i receive the following error:
\INCLUDE\afxtempl.h(443) : error C2582: 'CMyStruct' : 'operator =' function is unavailable
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xlocale(467) : while compiling class-template member function 'void __thiscall CArray<struct CMyStruct,struct CMyStruct &>::SetAtGrow(int,struct CMyStruct &)'
6. What could I be doing wrong??
Any help would be greatly appreciated.
|
|
|
|
|
Imlementation of SetAtGrow method uses an operator =. You need to implement one for your struct/class.
Pavel
Sonork 100.15206
|
|
|
|
|
does CMyStruct have an "operator =" member ? looks like that's what the compiler wants.
have you considered std::vector instead of CArray? overall, std::vector is a nicer way to deal with an array of things.
-c
Alcohol is the anesthesia by which we endure the operation of life.
-- George Bernard Shaw
|
|
|
|
|
hi there,
just wanted to let you'll know:
When i remove the CStringArray from the structure it works!
|
|
|
|
|
This is because of CStringArray has no "=" operator.
Best regards
Holger Persch
|
|
|
|
|
OK thats fine, but what happens when I **NEED** a CStringArray in my structure.
(Right now i have replaced the CStringArray by a char**) but thats not very elegant!)
|
|
|
|
|
then you need to write an "=" operator for your struct. in it, you'll copy all the data items from the input struct to "this".
-c
Alcohol is the anesthesia by which we endure the operation of life.
-- George Bernard Shaw
|
|
|
|
|
Do you mean implementing a = operator that copies from one CStringArray into another.
P.S:I say this, because i am now using a statically allocated char[][], thereby eliminating the need for copying!
|
|
|
|
|
Yes - you need to impliment operator = for CStringArray, as Chris has already said twice now.
As he has also said, the MFC container classes are plain ugly compared to STL, and std::vector would solve all of these problems as well as opening up a whole world of elegant container design to you.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
The "=" operator can look like this:
class CMyClass
{
.
.
.
const CMyClass &operator =(const CMyClass &src)
{
m_String = src.m_String;
m_StringArray.RemoveAll();
m_StringArray.Append(src.m_StringArray);
m_StringArray.FreeExtra();
return *this;
}
public:
CString m_String;
CStringArray m_StringArray;
};
Best regards
Holger Persch
|
|
|
|
|
Thanks so much for this Holger, that was very kind of you.
|
|
|
|
|
Is there any reason for which you prefer RemoveAll/Append/FreeExtra over CStringArray::Copy?
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
No, i have just not recognized that there exists a copy method .
Best regards
Holger Persch
|
|
|
|
|
I am trying to use PreTranslateMessage to translate a key press into a button click message. This is the code but it aint working:
<br />
BOOL CMScaleDlg::PreTranslateMessage(MSG* pMsg)<br />
{<br />
if (pMsg->message == WM_KEYDOWN)<br />
{<br />
if (pMsg->wParam == VK_F2)<br />
{<br />
pMsg->message = WM_COMMAND;<br />
pMsg->wParam = BN_CLICKED;<br />
pMsg->lParam = (LPARAM) ::GetDlgItem(GetSafeHwnd(), IDC_BUTTON1);<br />
}<br />
}<br />
return CDialog::PreTranslateMessage(pMsg);<br />
}<br />
The code which modifies the pMsg is being executed but nothing happens.
|
|
|
|
|
try:
pMsg->wParam = MAKEWPARAM(IDC_BUTTON1, BN_CLICKED);
When you send a WM_COMMAND message, the wParam variable contains 2 pieces of information, the notification code (BN_CLICKED ) in the HIWORD , and the control's ID in the LOWORD .
HTH
CPUA 0x5041
Sonork 100.11743 Chicken Little
"So it can now be written in stone as a testament to humanities achievments "PJ did Pi at CP"." Colin Davies
Within you lies the power for good - Use it!
|
|
|
|
|
Still not working. I tried a different method using PostMessage and this worked:
<br />
if (pMsg->wParam == VK_F2)<br />
{<br />
PostMessage(WM_COMMAND, <br />
MAKEWPARAM(IDC_BUTTON1, BN_CLICKED), <br />
(LPARAM) ::GetDlgItem(GetSafeHwnd(), IDC_BUTTON1));<br />
return true;<br />
<br />
}<br />
I can use this method, it seems to work ok, but I am curious why modifying the pMsg parameter doesn;t seem to work.
|
|
|
|
|
MFC has this warning all around the docs:Note This member function is called by the framework to allow your application to handle a Windows message. The parameters passed to your function reflect the parameters received by the framework when the message was received. If you call the base-class implementation of this function, that implementation will use the parameters originally passed with the message and not the parameters you supply to the function. meaning it will ignore the message and parameters you give it, and instead read the original message from a cache somewhere.
--Mike--
"I'd rather you just give me a fish today, because even if you teach me how to fish, I won't do it. I'm lazy." -- Nish
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
hello!
my cstring looks like that:
1;2;3;.....and so on.
i want to know, how i can delete the ';' inside this string.
is there a possibility to reset the ';' into a blank (' ')?
MFC
|
|
|
|