|
In my application I am using Shellexecute to run SQLs through isql.exe.
I want to trap the exceptions/errors which isql throughs in messagebox dialogs.
Can I trap those messages anyway out.
Souchakra
|
|
|
|
|
Try using SQL Server 2000 commandline tool osql which is the recommended tool for running sql scripts on commandline (if you not need to connect to SQL Server 6.5 or before). All sql server 2000 commandline tool output errors on stdout/stderr and there should be no message box at least. To catch the output it is a good idea to use the -o switch which directs it to the given file. (For more options see sql server 2000 online help "Using the SQL Server Tools)
Possibly the messagebox may occur because ShellExecute is used and has this (configured?) effect for the case of a stderr output?
|
|
|
|
|
Hai Juergen,
Thanx for your urly response.U suggested me of using osql but, I have to use Sybase Anywhere 5.5 which has the rtdsk50 eng free to distibute.For the same I am using isql.exe.
Could u suggest me anything related to this....
|
|
|
|
|
How can I register one file type with my application? I want my application to open all files that have the extension of ".tsx". I also would like to use DDE because I one instance of my program is always running and I do not want to run another instance. All I want is to send a message to the running instance. I am looking forward to hearing from you guys
Mustafa Demirhan
http://www.macroangel.com
Sonork ID 100.9935:zoltrix
<nobr>They say I'm lazy but it takes all my time
|
|
|
|
|
More than one hundred native Windows apps are using DDE file association already. So I guess it's not cumbersome to find them.
First thing to do is in Windows Explorer file association, check the use DDE checkbox, and type Open("%1") as DDE message, and system as Topic. This in itself in almost enough (depending then on how you handle default verbs in your apps).
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
In fact I did that. But when I do that, CWinApp tries to open the file on its own. But what I want is to do different things but I could not figure out how to. I overrided CWinApp::OnDDECommand () but this method is never called
Mustafa Demirhan
http://www.macroangel.com
Sonork ID 100.9935:zoltrix
<nobr>They say I'm lazy but it takes all my time
|
|
|
|
|
You must also have this in your CWinApp implementation :
EnableShellOpen();
RegisterShellFileTypes();
And you have MSDN articles [^]about it.
From a former app I somewhat remember, I also had a WIN32 message loop scrutening for WM_DDE_xxx messages. But this advanced advanced DDE use to transfer data using the clipboard.
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
Thanks a lot. This is a good start for me. But I still get error messages. I added these two lines, but OnDDECommand is never called. All I get is a stupid error message: "Windows cannot find 'c:\temp\yourfile.tsx'. Make sure that you typed the name correctly, and then try again. To search a file, .....". The error message directly comes from Windows Explorer and then my program is executed. But it never calls OnDDECommand . I don't know what's going on there
Mustafa Demirhan
http://www.macroangel.com
Sonork ID 100.9935:zoltrix
<nobr>They say I'm lazy but it takes all my time
|
|
|
|
|
Upps. One correction: First my program is started and then the error message comes directly from Windows Explorer
Mustafa Demirhan
http://www.macroangel.com
Sonork ID 100.9935:zoltrix
<nobr>They say I'm lazy but it takes all my time
|
|
|
|
|
I found my mistake: As the topic in Windows explorer I forgot to write "system". After I made the correction, everthing works great!
Mustafa Demirhan
http://www.macroangel.com
Sonork ID 100.9935:zoltrix
<nobr>They say I'm lazy but it takes all my time
|
|
|
|
|
I've searched high and low for some notification message that is fired when the checked state changes on a list-view with LVS_EX_CHECKBOXES set. It seems a little silly to have to do a hit test every time someone clicks the list-view window and check the mouse coordinates again to see if it falls in the checkbox area.
Am I missing something here?
--charlie
|
|
|
|
|
|
Hello,
I'm interested in expanding my C++ knowledge (OOD, MFC mechanics, etc.) and I would like to get advice on any publications/subscriptions that you folks believe is worth getting. Any ideas? What other resources (books, etc.) do you recommend?
Thanks!
JennyP
|
|
|
|
|
JeffProsise - MSPress - Programming Windows 95 with MFC
DaleRodgerson - MSPress - Inside COM
Those two teach the very roots of everything else.
Also a very valuable archive, free online : MSJ 1991-1998[^].
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
|
I'm amazed that no-one has suggested you buy the Bible - 'The C++ Programming Language' by Bjrne Stroustrup. Every C++ programmer should own it, and also his 'Design and Evolution of C++'
Beyond that, you should own the Langer & Kreft book on iostreams, a good STL reference, such as 'Generic Programming and the STL', and you may benefit from subscibing to the C Users Journal, despite a recent drop in quality it still has lots of good info on standard C++.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
I get the error
General error: Unable to read from file buffer occurred. Native Error Msg is: State:S1000,Native ,Origin:[Microsoft][ODBC Cursor Library]
from using a CRecordset derived class. Trouble is, I don't know which Open call is causing it because I have tried to comment the code in several places and it hangs up at different points each time.
I can see the CTTC* files in C:\TEMP directory and I have plenty of space there.
Does anyone have any idea? I looked up Microsoft Knowledge Base and they don't have anything for this error.
Thanks a lot in advance for any responses.
ashish
|
|
|
|
|
Hi All,
Does anyone know a better way of detecting an inactive system other than Global Mouse and Keyboard hooks. It would be nice if I could tell how long it has been since the user has performed any sort of user input to their system.
I do not like the GLobal hooks solution.
Thanks
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!
|
|
|
|
|
If you're on Win2k or better, you could maybe use GetLastInputInfo() . Or maybe install your own screensaver. Hooks do seem to be the most popular way though...
Shog9
------
Crazy lady with the shiny shoes, where are you?
Kick your feet and calm the space that makes you hollow
Live, Insomnia And The Hole In The Universe
|
|
|
|
|
Thanks, that's pretty much what I need.
(I guess I can live with hooks on Windows 98.)
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'm working on a project on C++ of numeric calculus. I need to incorporate to a complete project that is written on ansi C ... Naturally, after compilation, the C functions are presenting big errors.
Is it possible to incorporate, in any way, to my C++ project, other projects written on ansi C?
Thanks in advance !
|
|
|
|
|
Yes, and it is very easy. The VC++ headers have this in many of the files. Just add this little section :
#ifdef __cplusplus
extern "C" {
#endif
// your C prototypes go here
#ifdef __cplusplus
}
#endif
The Ten Commandments For C Programmers
|
|
|
|
|
I'm trying to make a map like this:
CMap<cstring,cstring&,buddyinfo,buddyinfo&> *BuddyList;
with BuddyInfo being a struct. But, I get this error when I try compiling:
error C2440: 'type cast' : cannot convert from 'CString' to 'DWORD_PTR'
The error is in the second-to-last line in the following code from afxtempl.h:
template<class arg_key="">
AFX_INLINE UINT AFXAPI HashKey(ARG_KEY key)
{
// default identity hash - works for most primitive values
return (DWORD)(((DWORD_PTR)key)>>4);
}
What am I doing wrong? Thanks!
|
|
|
|
|
IGx89 wrote:
What am I doing wrong? Thanks!
First, your template arguments are not visible because you typed < instead of <, which you can enter using the buttons below this window if you prefer.
Second, why are you using CMap instead of std::map ?
Apart from that, I cannot comment, because I use *real* containers, not the rubbish that comes with MFC. If you have some reason for using them, then I wish you luck in finding an answer, but making your template arguments visible may help people in replying.
Christian
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Christian Graus wrote:
because I use *real* containers
wow. i hope i never have to ask you a question, sir.
-c
bit, n:
A unit of measure applied to color. Twenty-four-bit color refers to expensive $3 color as opposed to the cheaper 25 cent, or two-bit, color that use to be available a few years ago.
|
|
|
|