|
I'm looking for any class that like the famous Oulook-bar control, is there any good one ??
Thanks much, Honza
|
|
|
|
|
http://codeguru.earthweb.com/controls/outbar.shtml
--------------
"Criticism is often constructive because it makes you feel superior when you give it"
-- Dogbert
|
|
|
|
|
Ok I want to write an application that interacts with a webpage in its CHtmlView..
I want to do the following:
1. Get feedback from the page on mouse-events, buttons clicked,... This I can do
2. Get interactive with the page and call javascript functions from the C++ code... This I can not do! Help!!
Can anyone help me to solve my problem?
thx
Wim Boffé
|
|
|
|
|
Hi,
I'm writing a postprocessor program for visualizing the results from
a Finite Element Analysis (FEA). The program is to be running in a
Windows NT/2000/98 environment.
I have three questions:
1. Is it possible to make a dialog transparent? If not, is it
possible to change the background color of it?
2. I don't manage to change the position of the tabs with the
CTabCtrl. They are on top now, but I want them to be on the right
side. There should be a command TCS_VERTICAL used with TCS_RIGHT but
when I do this, the tabs dont show up at all. Should I do something
extra?
3. I have'nt managed to disable some specific radio buttons on
the different tabs when the a specific solution is choosen (nodal
solution or element solution). When looking at a nodal solution all
radio buttons are to be enabled. But when pressing element solution,
specific radio buttons are to be disabled.
I use the following sequence:
m_first.GetDlgItem(IDC_RADIO101)->EnableWindow(FALSE);
RADIO101 is placed on dialog FIRSTDIALOG which belongs to CFirstDlg.
m_first is a CFirstDlg member. The program compiles, but there is a
runtime error when I press element solution. Any suggestions?
Best regards
Dennis Nilsson
M.Sc. Mech. Eng. Sweden
----------------------------------------
|
|
|
|
|
Question 1: Under W2000, yes. Under everything else there is a transparent flag, but it doesn't do much useful. Changing the background colour is easy - use FillSolidRect in OnPaint or OnEraseBackground
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
I have a dialog with buttons and Listbox control. I know how to set the font of the dialog in Resources, but all controls have to use the same font. Can I set the dialog font in Time New Roman, and the Listbox control uses Courier New?
Thanks
|
|
|
|
|
Hello, the codegurus around the world.;)
Sure, we can do that.
After you create CFont object with each font type, and use SetFont to each control
to update the font type.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
I have a dialog-based app with a menu.
Now I want to extend the menu at runtime with other items (read from a file)
The example at codeproject didn't take me any further.
Now there's one problem:
CMenu *menu = GetMenu();
menu->AppendMenu(MF_STRING,ID_POPUP_DynCmd01 + (i-1) ,menuName);
The problem is that the new items are not inserted below the last item in the menu but right next to the first menu item. They're inserted this way:
[POPUP] [Dyn1] [Dny2] [Dny3] ...
but should be inserted that way:
[POPUP]
[Dyn1]
[Dyn2]
[Dyn3]
...
does anyone know why this happens that way?
thanks in advance
|
|
|
|
|
I found the error by myself. But now I have anonther problem:
Now all items are inserted in the right place, but when I use the flag "MF_POPUP" they are not inserted into the popup-menu
|
|
|
|
|
try this one:
TCHAR szString[256];
m_Menu.CreatePopupMenu();
/* insert items in m_Menu using the AppendMenu function */
pMenu = GetMenu();
pMenu->EnableMenuItem(ID_MENU_POPUP, MF_ENABLED);
pMenu->GetMenuString(ID_MENU_POPUP, szString, sizeof(szString), MF_BYCOMMAND);
pMenu->ModifyMenu(ID_MENU_POPUP, MF_BYCOMMAND | MF_POPUP, (UINT)m_Menu.m_hMenu, szString);
/* end */
ID_MENU_POPUP is the menu ID of the menu item where you want a popup menu to be inserted.
Make sure you destroy m_Menu after using it. Use the DestroyMenu function for this one.
|
|
|
|
|
I have a simple component written in c++ that uses Apache Xalan/Xerces to do XSL Processing - for the sake of getting to the heart of the problem I am having I have hard coded it to a small XML/XSL pair (strings in the code).
When I create an ASP page which uses this component it works fine the first time (outputs transformed XML) - but any number of times I try after that it is failing (outputs nothing). I have debugged into the Apache code and it seems to be failing at a custom smart pointer (as much trouble as help!) creation deep within the code for creating a source tree out of the XML (remember it works fine the first time) (XalanSourceTreeParserLiaison.cpp line 167).
Now the strange part is that if I create a VB test app to use my component it works fine every time.
The really unfortunate thing is that the Apache code has a try {} catch {} surrounding the code that fails but it is catching (...) (above it there are comments saying "need to fix this") so I cannot see what exception is being thrown.
Any thoughts? My assumption is that this has something to do with threading... But that's just my guess.
|
|
|
|
|
it turns out that inside of the Xerces code (which Xalan uses as an XML Parser - everyone act surprised) there is use of static function scope variables. These get initialized upon creation and stay around until the process they were created in dies.
the Xalan/Xerces system needs to be initialized/terminated, and in the termination process a number of objects that have been hanging around are deleted... one of them is a mutex object that was _pointed_ to by one of the aforementioned static function scope variables. This static function variable is returned by its function unchanged if it already has a value or with a new address (housing a new mutex object) if it is NULL. the returned handle to the mutex is fed to ::EnterCriticalSection() which will barf if the handle is invalid.
to recap - after you call Terminate() the handle isn't valid and since it is static and ASP doesn't unload dlls immediatly (it just loads that baby up and keeps on getting new handles to instantiations of the objects of it) the pointer to the handle is still around. so the next time that an ASP page is accessed which creates this object an exception is thrown within Xalan and no transformation takes place.
The solution is to Initialize() and Terminate() the Xerces/Xalan system at the process creation/deletion level which I did by adding the appropriate code to DLLMain and removing it from elsewhere. Now things work great and the only thing I have to worry about is the fact that from the time the DLL is loaded into memory by ASP to the time it is finally removed I have the Xerces system up and ready to go (potentially taking up memory....).
|
|
|
|
|
When I call MAPISendMail(..), it will only execute correctly if I have Outlook running. If Outlook isn't running I get a MAPI_E_LOGIN_FAILURE error returned. I've tried MAPILogon to create a session, still no luck. Any ideas?
|
|
|
|
|
Hey Kevin...how are you calling MAPISendMail?? You can specify as a calling parameter to popup a MAPI logon box to authenticate yourself...
Erik
I hit faked him with my win32 API .chm and the peabrain goes for it. I follow it up with a salvo of left's and right's sending him down hard. It's lunch time and he's getting a Champ Sandwhich Special. I said, How's that Mr. VB?! Is that 'I wanna use COM in that Server enough for you?!'
...Ever since then, I've been the Champ.
|
|
|
|
|
Hi there,
i'm curious about how does static_downcast and dynamic_downcast works ???
Thanks for any answer !
Have a nice day !
|
|
|
|
|
I have a class derived from CObList. When serializing this class it writes to the disk just fine. However
when reading from the file, the serialization aborts with an unexpected file format.
I'm getting "Warning: Cannot load CGroups from archive. Class not defined." in the debug window, coming
from a TRACE call in arccore.cpp.
My question is that, according to all the information I am gathering from sites, calling CObList::Serialize( ar ) from
within my CGroups::Serialize( ar ) method should perform the proper serialization of the object and even
store the CGroups object information in the file so that on a read the CArchive knows what object it is
retrieving.
Yet, arccore.cpp still returns for me the message above and the serialization bottoms out.
Does anyone have any leads as to a culprit for this problem?
Thanks!
"Why are we hiding from the police, Daddy?"
"We use VI, son. They use Emacs."
|
|
|
|
|
CGroup::Serialize code, please
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
void CGroups::Serialize(CArchive& ar)
{
CObList::Serialize( ar );
if (ar.IsStoring())
{
ar << m_GroupCode << m_GroupDescription;
}
else
{
ar >> m_GroupCode >> m_GroupDescription;
}
if(AfxIsValidAddress(*(void**)m_Categories, sizeof(void*), FALSE))
m_Categories->Serialize( ar ); //another CObList
}
"Why are we hiding from the police, Daddy?"
"We use VI, son. They use Emacs."
|
|
|
|
|
I'd set a breakpoint in arccore.cpp, line 318. Each object serialized via operator << is preceeded by the class name. Your problem is related to file layout - when application reads file, class name is missing/invalid. Looks like calls to CArchive methods related to writing and reading differs in order - maybe you screwed something in CYourDoc::Serialize?
BTW: Why are you using AfxIsValidAddress? I'm not sure if this is your problem, but testing for validity of the object this way seems strange. It's *your* code and you should know if m_Categories is valid or not. AfxIsValidAddress only checks if object is withing the program's memory space.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hey,
if (ar.IsStoring())
{
ar << m_GroupCode << m_GroupDescription;
}
else
{
ar >> m_GroupCode >> m_GroupDescription;
}
This looks pretty dangerous. I've learned that it's not a good practice to trust the compiler to handle expressions like these in the right order (which one will be serialized or deserialized first, m_GroupCode of m_GroupDescription?)
I'd say:
if (ar.IsStoring())
{
ar << m_GroupCode;
ar << m_GroupDescription;
}
else
{
ar >> m_GroupCode;
ar >> m_GroupDescription;
}
Structured programming vs. chaotic mind boggling
|
|
|
|
|
Hi,
I have a big speed problem...
I'm working on a database and I access it on a SQL server on local network..
It takes me about 1 minute to write 7000 records... That's way to slow!
I thought at first it could be the network speed that would make it slow but I made tests with an MS Access database on the same network and without changing a line of code, writing 7000 records takes less than a second!!! So the network is not the problem...
Could the problem be in my code? Or is it MSSql that is to slow?
Somebody have an idea on that?
It would be very appreciated!
Thanks
Frederico
|
|
|
|
|
How you are inserting records?
With Insert or with a Store Procedure?
Do Inserts is slow in SQL Server, is More quick To execute a Store Procedure that make the insert.
Carlos Antollini.
|
|
|
|
|
I'm using MFC class CRecordset.
I create a class derived from CRecordset and bind all fiels to the database fields.
Then I create an instance of that class and establish the connection through an ODBC an a CDatabase object.
CTableOneSideData* cxOneSide = new CTableOneSideData(cxDatabase);
//open the table
if(cxOneSide->Open(NULL))
{
if (cxOneSide->CanAppend())
{
//insert values into fields
}
cxOneSide->Update();
}
Could you tell me more about Store Procedure?
Thanks a lot.
Frederico
|
|
|
|
|
I know that several Windows standard fonts, like Times New Roman have app. 500~700 symbols for different charsets. How can i use all the symbols in VC++. I know i may specify SYMBOL_CHARSET or DEFAULT_CHARSET, how can i use them both at the same time?
|
|
|
|
|
Hello, the codegurus around the world.;)
Try to use CRichEditCtrl to change the character set on the selected text.
CRichEditCtrl::SetSelectionCharFormat
However, I never use this, but it might work.
Have a nice day!
-Masaaki Onishi-
|
|
|
|