|
Uh ?
What are you talking about ?
|
|
|
|
|
So you didn't understand. Put the code here so it's better for someone to help.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
I had a similar problem recently and installing the 'Redistribution Package' did not solve it.
I found the Dependency Walker utility really handy (and its free), as it lets you see which libraries/dlls are needed for your app and a missing dll seems to be the cause of this error most of the time. Here's the link .....
http://www.dependencywalker.com/[^]
Hope this helps,Ali
|
|
|
|
|
hi,
i have created a toolbar and enable tooltips nw i want to attach tooltips.hw can i do that?
|
|
|
|
|
Try to define your strings in the yourapp.rc file :
STRINGTABLE
BEGIN
IDC_CMD_BUTTON_1 "This is the tooltip for button 1"
IDC_CMD_BUTTON_2 "This is the tooltip for button 2"
IDC_CMD_BUTTON_3 "This is the tooltip for button 3"
IDC_CMD_BUTTON_4 "This is the tooltip for button 4"
...
END virtual void BeHappy() = 0;
|
|
|
|
|
Hi,
I have an application that uses CHtmlEditCtrl for some WYSIWYG HTML editing. All is good, except that I need to add some custom protocols to the Hyperlink editor dialog. I have tried a couple of ways of doing this, but have some up against problem with each. The things tried are:
1. Open our own dialog in place of the in-built: ok if adding a new link, but when editing a link don't get the default behaviours of selecting the whole link text if caret is in middle of link, and can't get the existing URL to edit.
2. Catch the creation of the dialog with a hook, so I can fiddle with its controls: no good - the hook doesn't get entered on creation of the dialog
I would prefer option 1 if I can:
a. get it to select the whole link text (may not be required, but better if it can)
b. retrieve the URL of the selected link
Does anyone have any ideas? Has anyone managed to successfully intercept the Hyperlink dialog in any way?
Thanks,
Paul. "The way of a fool seems right to him, but a wise man listens to advice" - Proverbs 12:15 (NIV)
|
|
|
|
|
Hi
can any one please tell me how to convert one DWORD
to CString in VC++. (Both in Hex and decimal Formate)
|
|
|
|
|
Try it :
DWORD dwTest(1234);
CString cszTest;
cszTest.Format(_T("DEC: %u; HEX: 0x%08x"), dwTest, dwTest); virtual void BeHappy() = 0;
|
|
|
|
|
Hi
Thanks for your kind reply..
I tried the way, but i guess it is showing me the memory location
DWORD dwTest(0xFFFFFFFF);
CString cszTest;
cszTest.Format(_T("DEC: %u HEX: 0x%08x"), dwTest, dwTest);
cout<<cszTest;
I am getting a output of
0036AA20
|
|
|
|
|
problem may be with cout and unicode. To ensure it, try with _tprintf(_T("%s", cszTest));
I don't know whether there is any unicode version of cout.
|
|
|
|
|
Cool_Dev wrote: I don't know whether there is any unicode version of cout.
wcout[^]txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
yep.. got it from Rajeesh's post
|
|
|
|
|
hrishi321 wrote: cout<<csztest< blockquote="">
try changing change it to:
CT2A pszTestA( cszTest );
cout << (LPCSTR) pszTestA;
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
If the project setting is UNICODE, you may have to use as follows:
wcout << (LPCTSTR)cszTest;
Give it a try if cout is not working
|
|
|
|
|
hi
i need to gain the path of adobe acrobat but i don't know how.
i know that i can use registery but i don't know the adobe acrobat's key in registery.
can you help me?
thanks.
|
|
|
|
|
I could find it, for the version 9.0 :
HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Acrobat Reader\9.0\Installer\Path virtual void BeHappy() = 0;
|
|
|
|
|
do you think the other version, store in the other place?!!
|
|
|
|
|
Yes, I think so,
the registry path part "9.0" may be different... virtual void BeHappy() = 0;
|
|
|
|
|
Have you tried AssocQueryString() ?"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
|
|
|
|
|
The code:
class testClass {
public:
testClass() { m_buff = new BYTE[20];
memcpy(m_buff, "0123456789", 10);
};
~testClass() { delete m_buff; };
operator LPBYTE () { return m_buff; };
void show() {
cout << "m_buff = " << (__int64) (void *) m_buff << "\n\t";
for (int i = 0; i < 10; i++)
cout << m_buff[i];
cout << "\n";
};
private:
LPBYTE m_buff;
};
int main(int argc, char * argv[])
{
testClass * foo = new testClass();
foo->show();
cout << "foo = " << (__int64) (void *) foo << "\n";
cout << "(LPBYTE) foo = " << (__int64) (void *) ( (LPBYTE) foo ) << "\n\t";
for (int i = 0; i < 10; i++)
cout << ((LPBYTE) foo)[i];
cout << "\n";
delete foo;
return true;
};
And some output:
m_buff = 9180016
0123456789
foo = 9179968
(LPBYTE) foo = 9179968
-garbage-
I was expecting to see:
m_buff = 9180016
0123456789
foo = 9179968
(LPBYTE) foo = 9180016
0123456789
What am I missing ?
I know I could accomplish something similar with a member function returning the address of m_buff , but in my ever more ridiculous quest to learn more aspects of C++, I wanted to try this operator overloading bit....
As always, any guidance you can offer is greatly appreciated.
MZRmodified on Wednesday, March 17, 2010 5:11 AMP.S.
My apologies for using __int64 ... I know it's Microsoft specific, but I use what I've got.
|
|
|
|
|
Mike the Red wrote: operator LPBYTE () { return m_buff; };
Don't you mean (LPBYTE)*foo since foo is a pointer?
/Moak
PS: You might want to add copy constructor and assignment operator to your class. Law of the Big Two, classes that handle memory/resources usually need a copy constructor and an assignment operator.
|
|
|
|
|
I didn't understand your post until Pallini gave a longer explanation of this.
Thanks for your help!!!
PS:
Thanks for the suggestion about the Big Two, but I don't think so in this case.
The idea behind the class is for it to always behave as a dynamically-allocated LPBYTE , but somtimes point to a MMF, when the buffer is larger than a certain threshold.
In both cases (true LPBYTE or LPBYTE pointing to an MMF), the standard memory functions (memcpy , memset , etc.) are appropriate.
(Which is why I want the cast to point to the same place as the member pointer m_buff .)
|
|
|
|
|
Good teamwork with Pallini
|
|
|
|
|
Mike the Red wrote: I was expecting to see:
Mike the Red wrote: m_buff = 9180016 0123456789 foo = 9179968 (LPBYTE) foo = 9180016 // same address as m_buff
0123456789
Mike the Red wrote: What am I missing ?
The address of the class and the one of the m_buff variable (i.e. &m_buff ) are the same.
On the other hand, the address of the class differs from that of the memory buffer (i.e. m_buff ).
To verify, add the following line to the show method:
cout << "&m_buff = " << (__int64) (void *) &m_buff << "\n\t";
(that happens because of dynamic memory allocation).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I changed the operator function to:
operator LPBYTE () { cout << "Inside operator.\n"; return &this->m_buff[0]; };
...but Inside operator. never appears in the output.
If I explicitly use foo->operator LPBYTE() then Inside operator. appears in the output but not if I use an explicit cast (LPBYTE) foo .
Any ideas on that one ?
Thanks,
MZR
|
|
|
|