|
Rage wrote: "docking windows"
Funny about a minute ago it dawned on me to change my search params. Low and behold there is all kinds of info. Gee
Thank you for the reply.
ZeePain! wrote: This seems like one of those programs that started small, grew incrementally, building internal pressure, and finally barfed all over its source code sneakers. Or something.
thedailywtf.com[^]
|
|
|
|
|
I have a .DBF file. Is it possible to do some database operation on this file using ODBC on some machine where SQL Server is not installed? If so can you show me a small code sample? (The application that i use is written in Visual C++ 6.0)
Thanks
Aljechin Alexander
|
|
|
|
|
ODBC is just an interface - it has no engine for SQL Server.
|
|
|
|
|
Google Web accelerator highlights prefetched links with a double-underline, but I dont see the web page being modified. I know this application is a BHO, so can someone tell me how can a BHO modify the look and feel of the web page?
PS: What is the difference between BHO and a add-on?
thanks!
|
|
|
|
|
A BHO can basically do whatever it wants :p
A BHO sits in the browser app, thats outside the page, and add-ons are embedded in the page. For that reason BHOs has a wider view of things.
|
|
|
|
|
I have a try/catch block that is throwing an exception. What are the different things I can find out about the exception? line number, exception type, etc?
thanks!
|
|
|
|
|
simply put - what u throw is what u get.
try/catch are not defined to give info like line numbers, only what was thrown.
to get more info u'll have to use SEH, but then u lose unwind semantics...
|
|
|
|
|
What I do is to buld a string containing the value of __LINE__ and pass this to a global ThrowError function which packages this into an object which throw can throw.
For example:
class CMyError : public CException {
public:
const char * Message;
};
and somewhere in the code:
static CString s;
s.Format("File %s, line %d\nOverflow in addition", THIS_FILE, __LINE__);
ThrowError(s);
where ThrowError puts its argument into Message in an instance of CMyError and throws the CMyError. So basically I can send any information I want to via a throw.
Shraddhan
|
|
|
|
|
1. Thanks for the suggestion, but I think that is not really what I want. If I know where to throw the error I know where the error is really happening. What I was looking for is line number for unexpected errors.
2. To __yb: I learnt that you can do all with C++ try/catch that you do with SEH through _set_se_translator. So if you can use SEH to get the instruction pointer that caused the error, you can obtain the same using C++ try/catch too.
3. For a suggestion to my own query, I can think of a _dirty_ way to obtain the line number in a try/catch or even with SEH. Before compiling the code write a script that will insert this statement after every line of code:
g_lineno = __LINE__;
and then in your exception filter, you can print this global variable g_lineno.
Now what I want to know from you guys is, whether this is going to be a performance hit if I implement it in production. I think _no_big_deal_ but what is your opinion?
thanks!
|
|
|
|
|
Brundiez wrote: Now what I want to know from you guys is, whether this is going to be a performance hit if I implement it in production. I think _no_big_deal_ but what is your opinion?
My understanding is that there are quite large overheads in doing a throw / catch. Also, what happens afterwards? Does the code keep running, or do you inform the user?
Either way, I reckon it is no big deal. Especially when you include the time taken to actually deal with the line number information. The cost of storing the line number in a global variable is nothing in comparison.
But I've just noticed that you say:
Brundiez wrote: Before compiling the code write a script that will insert this statement after every line of code
*Every* line of code? Do you *really* need to know so precisely?
Shraddhan
|
|
|
|
|
can anybody tell or give me some Visual C++ shortcut keys. I've been looking for shortkeys over the internet but I cant find one. Your help is greatly appreciated.
|
|
|
|
|
|
i write a activex and want to use it in word,and i want to capture the DocumentBeforePrint event so that i can prevent the word doc to be printed.what can i do?
|
|
|
|
|
My dialog program will start another dialog by pressing a button
Cxx dlg
dlg.DoModal();
In the Cxx dialog, I will create font by doing this
//Cxx.h
CFont m_font1;
//Cxx.cpp
//BOOL Cxx::OnInitDialog()
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT)); // Clear out structure.
lf.lfHeight = 25; // Request a 25-pixel-high font
lf.lfWeight = 700;
strcpy(lf.lfFaceName, "Arial"); // with face name "Arial".
m_font1.CreateFontIndirect(&lf); // Create the font.
The problem is that when I try to start the Cxx dialog second time.
The program will get error in creating the m_font1 again.
Please help!
|
|
|
|
|
|
Is it possible to destroy it.
Please help!
|
|
|
|
|
LaHaHa wrote: Is it possible to destroy it.
Yeah
m_font1.DeleteObject();
LaHaHa wrote: Please help!
My Pleasure
Jesus Loves <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background:#ffaaaa">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Thank you very much!
I got it!
|
|
|
|
|
Hi
I want to ask you one think. How fancy GUIs for Windows applications such as MS Calculator plus, Norton system works, and other todays softwares having there own window, title bar, buttons, and other common controls, are created?
We Believe in Excellence
|
|
|
|
|
This is a pretty general question. All UI elements are ultimately a window, and so ultimately they are all created using the same Win32 underlying function. Beyond that, any fancy controls probably draw themselves.
System Works is definately a bunch of owner drawn controls.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Aqueel wrote: How fancy GUIs for Windows applications such as MS Calculator plus, Norton system works, and other todays softwares having there own window, title bar, buttons, and other common controls, are created?
They do the drawing by themselves. You can do the same way too. But you have to take care of all aspects of the drawing.
Even the dialog boxes, frame, mdi windows, etc that appear are drawn somewhere that's why they appear the way they do.
For example you can take ownerdrawn(not me) buttons, listboxes, comboboxes etc.
The guys who are involved in this type of work are experts.
Jesus Loves <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background:#ffaaaa">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Owner drawn wrote: For example you can take ownerdrawn(not me)
lol
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
-- modified at 1:24 Thursday 12th January, 2006
|
|
|
|
|
Aqueel wrote: How fancy GUIs for Windows applications such as MS Calculator plus, Norton system works, and other todays softwares having there own window, title bar, buttons, and other common controls, are created?
this will good start for evry thing http://www.codeproject.com/script/articles/subcat.asp?id=3[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
|
Try subclassing it and overriding the WM_CONTEXTMENU[^] message.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|