|
Hello there,
I wrote a MFC exe project, How can i make an ActiveX of it ?
Regards,
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Is there a way with the CWebBrowser2 Control to know if URL that i want to display is invalid (wrong URL, File does not exist, Connection Problem ....) ?
Thanks
Olivier
|
|
|
|
|
I have found the solution :
In the event sink map, you have to add
ON_EVENT(CWebBrowser2, ID_WEB_CTRL, DISPID_NAVIGATEERROR, OnNavigateError, VTS_DISPATCH VTS_PVARIANT VTS_PVARIANT VTS_PVARIANT VTS_PBOOL)
and in the code :
<br />
void CWebBrowser2::OnNavigateError (LPDISPATCH lpDisp,VARIANT FAR* URL, VARIANT FAR* TARGET , VARIANT FAR* STATUS, VARIANT_BOOL * CANCEL)<br />
{<br />
*CANCEL = VARIANT_TRUE;<br />
}<br />
|
|
|
|
|
Hi,
I have created a modeless Property Sheet. I now want to add pages at run time (remove pages then add pages) so that my property sheet has at most 2 pages at one time.
THE PROBLEM IS that I get an error when I try to do this. The debugger replys that a window handle is null (0x00000).
If I create the sheet and add the pages in while in the Sheet's constructor, I don't get an error. But if I try to add a page during run time, I get an error. What is wrong and how can I correct this? Please help.
Here is what I want:
Page 0 (zero) -- page that will be swapped in/out
Page 1 -- page that always appears. Must be the right most page (on tab)
I have my callbacks in CMainFrame class and I have done the modeless Property Sheets before -- when pages are not removed/added dynamically.
Thanks in advance for the help. Code snipet follows
Johnny
void CMainFrame::OnModelessPropSheet()
{
CBasicEventPage pageBasicEvent;
CPageBlue pageBlue;
/********** // 11/12/02 - dynamic add/removal of pages not yet working
int nPageCount;
// Remove both pages (event and the Basic Event Data)
nPageCount = m_pSheetManEvents->GetPageCount();
for (int i=0; i < nPageCount; i++)
m_pSheetManEvents->RemovePage(i);
// Add pages back in (starting with Blue and then Basic Event Data)
m_pSheetManEvents->AddPage(&pageBlue);
m_pSheetManEvents->AddPage(&pageBasicEvent);
m_pSheetManEvents->SetTitle("Insert Blue", 0);
**********/
if (m_pSheetManEvents->IsWindowVisible())
{
m_pSheetManEvents->SetFocus();
}
else
{
m_pSheetManEvents->ShowWindow(SW_SHOW);
}
}
|
|
|
|
|
There is one alternative solution. You can setup the sheet to not show a certain page. In other words, you can keep the sheet from diaplaying a page via redirecting the active page as the user tries to focus the hidden page. This solution, however, does not hide the tabs.
As an experiment, see if there is a member function for CPropertySheet that hides a page.
|
|
|
|
|
Thanks. That sounds like a good work around.
I might include all the pages (I will have at most 7) and then hide the 5 that I don't use (including their tab). There should be a method to hide pages with the TAB not displayed. ???
I also found an example on a Property Sheet alternative from Chris Losinger - a Preference dialog (http://www.codeproject.com/property/saprefs.asp) This may come later as time permits.
Thanks for the reply.
Johnny
|
|
|
|
|
Hello,
I had a question concerning non-visual C++, but I figured I'd ask you guys anyways because you guys know a lot. I am using the string class in C++ (not a char array), and I want to convert it to an uppercase string. I know that char arrays have a toupper() function where you can turn the array, letter by letter, into uppercase values. If I use c_str() and convert my string into a null terminating string. Is it possible though to acces the values of the string, letter by letter?
Thanks a bunch,
Nickone
|
|
|
|
|
You can use operator [] to access individual characters of the standard std::string .
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
sweet!
Thanks a whole bunch. I was trying to use the data() function, but this way is simpler.
|
|
|
|
|
The STL-way of doing this (and here we have a place where STL really shines)would be
std::string s("Mellon");
std::transform(s.begin(), s.end(), s.begin(), toupper);
std::cout << s << std::endl;
std::transform(s.begin(), s.end(), s.begin(), tolower);
std::cout << s << std::endl; You need to include the algorithms header for transform, but otherwise it is pretty straightforward:
Take each element from s.begin() to s.end(), put them to s.begin() (and so on) after you called toupper/tolower with them.
Hope this helped
|
|
|
|
|
You can also use the strupr function but it's not nearly as elegant as the STL solution offered above:
string strData = "Data";
strupr(const_cast<char*>(strData.c_str()));
Regards,
Alvaro
Well done is better than well said. -- Benjamin Franklin
(I actually prefer medium-well.)
|
|
|
|
|
Good morning everyone.
I have a question. I wrote a dictionary-based password
filter and have successfully implemented it on my win2000
machine.
However, when I purposely change my password to something
I know will NOT be accepted by the filter, i get this
message ...
<br />
"Your password must be at least 6 characters; cannot <br />
repeat any of yoru previous 3 passwords; must contain <br />
capitals, numerals, or punctuation; and cannot contain <br />
your account or full name. Please type a different <br />
password. Type a password which meets these requirements <br />
in both text boxes."
I'm using CTRL-ALT-DEL to change my password. Is there
any way at all to customize this notification popup so
that I can state my own rules of passwords? Thank-you in
advance for you time
I'm new here, pardon the n00bing
|
|
|
|
|
WMP can only play MPEG2 files if you have installed an external software DVD player. Now i ask, how can WMP utilize that driver that the other program installs?
All help appreciated!
-Rune Svendsen
|
|
|
|
|
It's just a player codec, I think. Works the same as decoders for any other video format (such as divx)
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Unfortunately not. I've checked, there's no MPEG2 decoder present as a vcm driver.
|
|
|
|
|
How can I get the hot spot from the cursor?
Best regards,
Eugene Pustovoyt
|
|
|
|
|
Hello,
I have a SDI program that where I derived two classes from the CRichEditCtrl. In OnCreate inside the view I create the two rich edit controls (one takes up 80% of the view and the other takes up 20% of the view).
The problem that I am having is that if I do a SendMessage() inside of either of the rich edit controls or inside the view the SendMessage isn’t being seen by 9x machines. Everything seems to be working fine on 2k.
For example:
In my View I do a ::SendMessage(m_ctrlRichEdit1.GetSafeHwnd(),EM_SCROLLCARET,0,0);
Or
In CmyRichEdit1 I do a SendMessage(EM_SCROLLCARET,0,0);
The message isn’t being seen on 9x only..
What am I doing wrong?
|
|
|
|
|
As an experiment, see the message to main frame.
AfxGetMainWnd()
GetParent()->GetSafeHwnd()
Kuphryn
|
|
|
|
|
Well the message must be being sent, but possibly isn't being received correctly. Have you tried using Spy++ or WinSpector to watch the messages? Also have you checked the SDK docks for any differences in the Richedit control across Windows platforms.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Your right they are being sent.. Using spy++ I see the send and receive.. but I am unsure what this means.
R EM_SCROLLCARET fSentToEditCtrl:False
Does this "fSentToEditCtrl:False" mean that the message isn't being sent to the edit control even though the edit control sent the message?
|
|
|
|
|
Well I'm not too sure off the top of my head the exact meaning of the Spy info.
In CmyRichEdit1 I do a SendMessage(EM_SCROLLCARET,0,0);
This will send it to itself as you haven't spec'd pView->SendMessage().
Is it both of the SendMessage() cases you are having a problem with or just one?
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
when I do a pEdit->SendMessage or a SendMessage or a ::SendMessage the control doesn't do what it's supposed to on 9x, it works perfectly on 2k.. I do a SetSel(-1,-1) to move the cursor to the end of all the text then i do a SendMessage(EM_SCROLLCARET,0,0) to scroll the caret into view.. works great on 2k but it doesnt do anything on 9x the screen sits at the top while the the text piles up at the bottom.. such a weird problem.. I checked all the documentation and it says that every call I am making only requires richedit 1.0 supported in 95 and up.. sooo weird.
|
|
|
|
|
So I assume the caret moves correctly to the end of the control, but EM_SCROLLCARET isn't bringing it into view. Are testing the return values from SetSel() and SendMessage(). Try doing a search on MSDN for EM_SCROLLCARET and see what comes up. Or maybe don't use the RichEdit control.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
Thanks for all your help.. I'll do some more research to see if I can't figure this out.
|
|
|
|
|
OK. I have an animation control which has the ACS_TRANSPARENT style. The AVI contains 16 color images (using a magenta background). Teh video displays fine on systems running 32 bit color depth. However, anything less than that is showing the magenta background instead of making it transparent. Does anyone have any suggestions on how to get this to work correctly?
Brigg Thorp
Software Engineer
Timex Corporation
|
|
|
|