|
I just saw David's response to your email. Never mind...
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I didn't see any documentation that you couldn't. I'd like one at the top and one at the bottom essentially taking up all of the client area. Is that possible?
|
|
|
|
|
Has anyone seen this problem with ADO query:
select /*?*/ 1 from dual
Basically it seems if the query / proc / function contains question mark, ADO query will return "Wrong number of parameters" error message. Change ? to '?' will be fine, but that alter the code as well.
For instance, the following code will cause problem:
create or replace function aaa return number
value number;
is
begin
value := select sum(amount) /*Total Amount?*/ from bill_info;
return value;
end;
Has anyone know what is the right escape for question mark?
Thanks.;P
|
|
|
|
|
How do I prevent my application showing a button on the taskbar?
Thanx
|
|
|
|
|
See this article.
/ravi
Let's put "civil" back into "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
|
Simply remove the WS_EX_APPWINDOW style from your window.
MFC:
pWnd->ModifyStyleEx(WS_EX_APPWINDOW, 0);
Win32 API:
LONG lStyle = ::GetWindowLong(hWnd, GWL_EXSTYLE);
lStyle &= ~WS_EX_APPWINDOW;
::SetWindowLong(hWnd, GWL_EXSTYLE, lStyle);
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
i have 2 methods that are using IWebBrowser2 to execute a print method from a com object that is hosted on a webpage. here is the code for the methods:
---------------------------------
STDMETHODIMP CTemplatePrinter::IEPrintNoPrompt(VARIANT varTemplateURL)
{
CComPtr<iolecontainer> spContainer;
CComPtr<iserviceprovider> spSP;
CComPtr<iwebbrowser2> spWB;
CComPtr<idispatch> spDisp;
CComPtr<ihtmldocument2> spDoc;
CComPtr<iolecommandtarget> spCT;
CComVariant vPTPath = varTemplateURL;
m_spClientSite->GetContainer(&spContainer);
spContainer->QueryInterface(IID_IServiceProvider, (void**)&spSP);
spSP->QueryService(SID_SWebBrowserApp, IID_IWebBrowser, (void**)&spWB);
spWB->get_Document(&spDisp);
spDisp->QueryInterface(IID_IHTMLDocument2, (void**)&spDoc);
spDoc->QueryInterface(IID_IOleCommandTarget, (void**)&spCT);
// ******* THIS IS WHERE IT'S GOING CRAZY!!!! ******* //
spCT->Exec(&CGID_MSHTML, IDM_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, &vPTPath, NULL);
return S_OK;
}
---------------------------------------
STDMETHODIMP CTemplatePrinter::IEPrint(VARIANT varTemplateURL)
{
CComPtr<iolecontainer> spContainer;
CComPtr<iserviceprovider> spSP;
CComPtr<iwebbrowser2> spWB;
CComPtr<idispatch> spDisp;
CComPtr<ihtmldocument2> spDoc;
CComPtr<iolecommandtarget> spCT;
CComVariant vPTPath = varTemplateURL;
m_spClientSite->GetContainer(&spContainer);
spContainer->QueryInterface(IID_IServiceProvider, (void**)&spSP);
spSP->QueryService(SID_SWebBrowserApp, IID_IWebBrowser, (void**)&spWB);
spWB->get_Document(&spDisp);
spDisp->QueryInterface(IID_IHTMLDocument2, (void**)&spDoc);
spDoc->QueryInterface(IID_IOleCommandTarget, (void**)&spCT);
// ***** IT CALLS THIS 2 TIMES? ******** //
spCT->Exec(&CGID_MSHTML, IDM_PRINT, OLECMDEXECOPT_PROMPTUSER, &vPTPath, NULL);
return S_OK;
}
--------------------------
my question is: does anyone have any idea why the IOleCommandTarget::Exec method it going berzerk? when i call the method from a script, the first one keeps spooling pages into the printer, and the second one opens 2 print dialogs in a row...i also have another function for opening a print preview window that works fine....the only difference is my call to Exec is as follows:
spCT->Exec(&CGID_MSHTML, IDM_PRINTPREVIEW, OLECMDEXECOPT_PROMPTUSER, &vPTPath, NULL);
i've tried all that i can see...if i replace spCT->Exec(...) with
spWB->ExecWB(OLECMD_PRINT, OLECMDEXECOPY_PROMPTUSER, &vPTPath, NULL);
it still does the same thing...i've even tryied without passing in the &vPTPath (printing template path) argument
i also know that the method is only getting called once...i tested this by also using spDoc to write some stuff out to pop up a message box every time it got called, and the message box only came up once, but the printing kept going...
any suggestions?
michael griffith
--------------------
mgriffith@lauren.com
mdg12@po.cwru.edu
|
|
|
|
|
I would like to set the font size of a dialog based on the screen resolution of the user's PC. Does anyone have a quick function to do this???
Thanks,
FL
|
|
|
|
|
i'm using a class from another program, but if i compile i get the a *.obj : error LNK2001:unresolved external symbol error, __imp__waveOutWrite@12. (waveOutWrite is the function declared in mmsystem.h) how can i fix this?
|
|
|
|
|
You must link with Winmm.lib .
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Hello there,
I came back !!!!
NICE TO MEET ALL OF YOU
Well, i have new question ... it's about finding a value in vector array !
As i know, find(one of STL functions) function could search in usual array very well ...
But how could i find a value in vector ???
Thanks in Advance
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
std::find(v.begin(),v.end(),value);
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hello Joaquín ...
my pal
thanks for your reply ...
But could u tell me how could i get the location of value in the vector ?
I know, i must check the return value of find function ...
But in which kind of variables ?
I must use iterator ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
std::find returns an iterator pointing to the position within the vector where the value was found. If the value is not found, end() is returned. Use std::distance in <iterator> to easily determine the location within the vector.
// warning untested code
std::vector<type>::const_iterator it = std::find(v.begin(), v.end(), value);
if (it != v.end())
{
std::vector<type>::differenc_type loc = std::distance(v.begin(), it);
}
Phil Boyd
MCP
CPT, AR
You may be gone, but we will never forget your sacrifice.
"Proud to be an American..." Lee Greenwood
|
|
|
|
|
Hello all,
Thanks for the dialog tricks answers. They were very helpful. Thanks a bunch.
So now I got more questions:
1)This code from MSDN help files
void CMainFrame::OnFileNewchild()
{
CMDIChildWnd* pMDIChildWnd = new CMDIChildWnd;
VERIFY(pMDIChildWnd->Create(
NULL, // standard CMDIChildWnd class
_T("My MDIChildWnd"), // caption of MDI child window
WS_CHILD | WS_VISIBLE | WS_OVERLAPPEDWINDOW, // window styles
rectDefault, // default rectangle size
this)); // parent window; can be NULL
// the default PostNcDestroy handler will delete this object when destroyed
}
This will create a new MDI Child Window if I paste it into the Mainframe.cpp class of my MDI app. What I'd like to know, is how to pass the messages to it to get it to do something?
I'd like it to open Bitmaps, and I have a bitmap file viewer that will open Bitmaps into the default MDI child windows. How do I send a message to the onDraw function to draw into THIS custom MDI child window?? Basically, how can I get this Window to do somethign apart from appear?
If any of you know how to go about doing this and on top of that, want to let ME know , I'd be mega-grateful. I really want to know how to do this. Does this involve creating a new Doc and view class? Arghhh...I'm kinda lost and some diretion would be nice
|
|
|
|
|
NickOne wrote:
This will create a new MDI Child Window if I paste it into the Mainframe.cpp class of my MDI app. What I'd like to know, is how to pass the messages to it to get it to do something?
If it'll always do the same thing, then put the code in the child windows constructor. Otherwise, there is code on MSDN to iterate through all open documents ( that is to say, I forget how to do it, but that is where I learned )
Christian
come on all you MS suckups, defend your sugar-daddy now. - Chris Losinger - 11/07/2002
|
|
|
|
|
Hey all,
I have been trying to figure out how to write a report and print it using Microsoft word from my Visual C++ project. Simply put all I want to do is write lines of text to word document and then print the document all for the user.
I have already included the Microsoft Word type library via the Class Wizard, but I have no idea on where to begin as far as using this information. I was wondering if anyone could point me to examples along this line... Or if anyone has an explanation of the type libarary classes that the class wizard created for me.
Any help and any leads are much appreciated...
Thanks,
Brian
Remember the next time something breaks that actions speak loud than words, so remember to use gestures while discussing the properties of clean code with your computer.
|
|
|
|
|
Hey Guys
I need some help with Multiple Inheritance in MFC like HOW THE HELL DO YOU DO IT?!?!?!?
I would like to create a class derived from an MFC class say CView and a generic class i have written which is a standard class deriverd from nothing. I have done it and got it to compile but it will crash when MFC calls the ISKindOf statment.
Any links to tutorials on this would be extremly useful.
|
|
|
|
|
MFC's RTTI (CObject::IsKindOf and friends) doesn't support multiple inheritance. You can get better results with C++ RTTI - dynamic_cast is the way to go.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
MFC RTTI is older than standard C++ RTTI and is more limited and manual. If MFC does the call to IsKindOf when it crashes, then you may not ba able to replace it with C++ RTTI (dynamic_cast) as suggested in another reply.
As an alternative, you may check your derivation order. Does your class first derives from the MFC class then from your class (which should probably not derives from CObject). If not, changing that may be a fix...
It is possible that MFC RTTI rely on the fact that the derived class start at the same adress as the base class but I am not sure that there is such a restriction. It's just a guess.
And does your class is properly defined for MFC RTTI uses? Maybe you should add some MFC macros in your derived class. I don't know... I think that it is optional as long as the information is not required. But maybe the problem is that the information is required by document templates to create the view.
Philippe Mori
|
|
|
|
|
Is IsKindOf duplicated or something? If not, I see no reason why what you describe should fail. Some code would be most helpful.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
I have a function which is supposed to fill in abc:
MyFunc(char* abc)
{
char* val = "aaa";
strcpy(abc,val);
}
Why do I have to strcpy?
If I just do:
{
char* val = "aaa";
abc = val;
}
then there is garbage in abc when it returns. WHat exactly is happening if you do it my second way? Why doesnt it work?
|
|
|
|
|
You can't do that and teh reason why is that in your second implementation you are trying to set the value of the pointer and not of the character array. And you need to actaully copy the memory containg the "AAA" string to the memory that the pointer points to.
Hope this helps
Peter
|
|
|
|
|
in the second, you are assigning the address of a local variable (val is local to the function) to a non-local variable. a local address is meaningless when used outside the function.
-c
To explain Donald Knuth's relevance to computing is like explaining Paul's relevance to the Catholic Church. He isn't God, he isn't the Son of God, but he was sent by God to explain God to the masses. /. #3848917
|
|
|
|