|
Hello, the codeguru around the world.
I don't think that the debugger is the powerful tool to check the error
of the heap memory allocation in VC++.
You had better check the code if you use the heap allocation function
like alloc by the right library or on the version of Windows OS.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
That's why I also tried running it under Purify NT, but it finds nothing...
- Anders
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Hello !
I have a problem with compiling my ADO connection as release
build
I will get this message as follows (in release build):
error LNK2001: unresolved external symbol "public: void __thiscall CDbAdoDoc::GenerateError(long,unsigned short *)" (?GenerateError@CDbAdoDoc@@QAEXJPAG@Z)
DbAdoView.obj : error LNK2001: unresolved external symbol "public: class CCustomRs * __thiscall CDbAdoDoc::GetRecSet(void)" (?GetRecSet@CDbAdoDoc@@QAEPAVCCustomRs@@XZ)
Release/DbAdo.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
DbAdo.exe - 3 error(s), 6 warning(s).
It seems that its only possible to compile with the debug library.
There is no problem running the program in debug-build.
The header-file only is used in the post class.
I have tryed various settings with the compiler switches
without any positive result.
I created this project in Visual Studio C++ 6.0 enterprise.
The database is access.
The same result with MYSQL and ORACLE.
Is there anybody with an solution
Thankyou in advance
Thomas
|
|
|
|
|
How can I add a new table to an existing Daodatabase?
Thanks.
Richard
|
|
|
|
|
Try to use "createNewTableDef"
function:
BOOL createNewTableDef(CDaoDatabase * pDatabase, CDaoTableDef **ppTableDef,CString strTableName)
{
if (pDatabase == NULL)
return FALSE;
// construct tabledef
*ppTableDef = new CDaoTableDef(pDatabase);
// failed to allocate so exit
if ((*ppTableDef) == NULL)
return FALSE;
// no duplication, so create the tabledef if possible
TRY
{
(*ppTableDef)->Create(strTableName);
}
CATCH (CDaoException, e)
{
// construct a meaningful message
CString strMessage = _T("Couldn't create tabledef--Exception: ");
strMessage += e->m_pErrorInfo->m_strDescription;
AfxMessageBox(strMessage);
// indicate failure
bCreateFailed = TRUE;
// delete the tabledef on failure
if (*ppTableDef != NULL)
{
delete *ppTableDef;
*ppTableDef = NULL;
}
}
AND_CATCH (CMemoryException, e)
{
// output status
AfxMessageBox(_T("Failed to create tabledef--Memory exception thrown."));
// indicate failure
bCreateFailed = TRUE;
// delete the tabledef on failure
if (*ppTableDef != NULL)
{
delete *ppTableDef;
*ppTableDef = NULL;
}
}
END_CATCH
// return TRUE if creation succeeds
return (!bCreateFailed);
}
|
|
|
|
|
What's the difference between Interface and dispInterface?
|
|
|
|
|
A dispatch interface is used mainly so late binding languages can discover and use your objects methods.
|
|
|
|
|
Also for event handling.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
Hi all!
I have a bunch of problems that fall under the general category of video streaming, and since this technology is rapidly advancing I'm hoping that other people are dealing with this too.
I have:
Analog camera -> osprey card -> Real Producer
I would like:
Analog camera -> osprey card -> my little program -> Real Producer
I'm afraid it might not be in the cards, but I've only done VFW stuff so maybe it can be done using DirectShow?
One problem is that I need to monitor the video stream (locally) but since the encoder is connected to the capture device I'm working around the problem by constantly peeking at the DC of the display window ( ) Is there a better way?
Another problem is that I need a _live_ display (to get a reasonably tight feedback loop, as in video conferencing) but the >10 second delay that makes the Real stream so smooth and low bitrate makes the latency too high. Again, I'm working around this by capturing the DC of the Real Producer display, shrinking it, compressing it to a jpeg, then sending it over the net to a receiving program. Very inefficient, but the point is to get improved latency which it does. But it still makes me gag.
By the way, the receiving program I'm using is a windows exe, but I'd like it to display on the web instead (users won't download stuff). I assume that the way to do this would be using java or an ATL control - neither of which I know now, but if this is the way to do it then I will learn. Any suggestions?
To vent another video complaint, my stinky little Real Producer voyeur program saves recent frames in a circular buffer and makes a video file from it upon request. However, it's a pain to use the driver's 'compression dialog' to set the compression parameters manually. I'm working around it by saving the result of the compression structure in a file. As an aside, is it possible to change the video format and source in a more programmatically flexible way than clicking on a radio button in the driver's dialog box? I think I remember DirectShow being able to do this though.
What's the legal status of the divx codec? Personal use? In-house use? Commercial use?
Another video question - There are lots of codecs for transforming (a bunch of raw frames) -> (a video file) but I'm looking for a way to replace sending a 'stream' of jpeg frames (generated on the fly) over the network. Any pointers?
Also I just noticed that versions of windows more recent than 95 have built-in JPEG support! My question is how compatible is this with other programs that read jpegs? Does the pointer to the bits contain a real jpeg, or do you have to do some header shuffling in order to get a bona fide jpeg from it? Any pointers? I'm sure looking forward to not having to deal with the IJG library.
Finally, I'm looking to replace the (analog video camera -> osprey card) with a digital video camera. Does anyone have any suggestions?
Much thanks to anyone who takes the time to reply!
|
|
|
|
|
I'm starting to develop some applications and considering 3rd party controls. I am use to developing in-house applications that use the default controls that come with Visual Studio Enterprise.
I have noticed this though, that most activeX controls advertised, are advertised heavily for Visual Basic. I thought all ActiveX controls where to work in all ActiveX compliment development enviornments? Also, I have downloaded some sample Active X controls and they really don't work in Visual C++. I tried adding it to a VC project, and got the COM wrapper class that C++ develops, and it would through a ton of erros. Thinking it was just how I used them I contacted the support company for one, and they emailed me a wrapper class for the ActiveX control?!?! Isn't it suppose to work in VC? This one expierence has left me exploring my options of using 3rd party controls for awhile.
For all of you expierenced in using 3rd party controls, is this common? Why doesn't all ActiveX controls work seamlessly between enviornemnts? Also, if anyone has links and suggestions for good GUI controls for VC please post them here, as I'm looking to build my library.
I already have Marbry, Sheridan(Infragistics), Component One, and Programmer's Paradise, any other companies and your personal recommendation would be greatly appreciated.
Sam C
----
Systems Manager
Hospitality Marketing Associates
|
|
|
|
|
I need to create an ActiveX digital clock that would switch to an analog face when clicked. A sample code would be very helpful...
Thanks!
Bok III
|
|
|
|
|
I want to start and run another program(.exe file) from my Visual c++ project by just click the menu item. what should I do,if there is any command like system(".....")to easily achieve that?
looking forward to your help!
jason
|
|
|
|
|
The easiest way is ShellExecute();
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Thanks,
Can you detail, Please ???
What do I exactly in my code if I want to acted for example the file:
game.exe
|
|
|
|
|
ShellExecute(handle_to_parent_window, NULL, path_to_file, NULL, NULL, SW_SHOWNORMAL);
Look in the VC help.
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
First I'd suggest you get the MSDN CD's, so you can look up these commands for yourself ( not that I mind helping, but you'll go crazy if you need to kick back and wait a day to find out things like the syntax for ShellExecute ).
(From MSDN)
ShellExecute
Performs an operation on a specified file.
HINSTANCE ShellExecute(
HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);
Parameters
hwnd
Handle to a parent window. This window receives any message boxes that an application produces, such as error reporting.
lpVerb
A string, referred to as a verb, that specifies the action to be performed. The set of available verbs depends on the particular file or folder. Generally, the actions available from an object's shortcut menu are available verbs. For more information about verbs and their availability, see Object Verbs. See Extending Shortcut Menus for further discussion of shortcut menus. The following verbs are commonly used: Verb Description
edit Launches an editor and opens the document for editing. If lpFile is not a document file, the function will fail.
explore Explores the folder specified by lpFile.
find Initiates a search starting from the specified directory.
open Opens the file specified by the lpFile parameter. The file can be an executable file, a document file, or a folder.
print Prints the document file specified by lpFile. If lpFile is not a document file, the function will fail.
If you set this parameter to NULL:
For systems prior to Microsoft® Windows® 2000, the default verb is used if it is valid and available in the registry. If not, the "open" verb is used.
For Windows 2000 and later systems, the default verb is used if available. If not, the "open" verb is used. If neither verb is available, the system uses the first verb listed in the registry.
lpFile
Address of a null-terminated string that specifies the file or object on which to execute the specified verb. To specify a Shell namespace object, pass the fully-qualified parse name. Note that not all verbs are supported on all objects. For example, not all document types support the "print" verb.
lpParameters
If the lpFile parameter specifies an executable file, lpParameters is an address to a null-terminated string that specifies the parameters to be passed to the application.The format of this string is determined by the verb that is to be invoked. If lpFile specifies a document file, lpParameters should be NULL.
lpDirectory
Address of a null-terminated string that specifies the default directory.
nShowCmd
Flags that specify how an application is to be displayed when it is opened. If lpFile specifies a document file, the flag is simply passed to the associated application. It is up to the application to decide how to handle it. SW_HIDE Hides the window and activates another window.
SW_MAXIMIZE Maximizes the specified window.
SW_MINIMIZE Minimizes the specified window and activates the next top-level window in the z-order.
SW_RESTORE Activates and displays the window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when restoring a minimized window.
SW_SHOW Activates the window and displays it in its current size and position.
SW_SHOWDEFAULT Sets the show state based on the SW_ flag specified in the STARTUPINFO structure passed to the CreateProcess function by the program that started the application. An application should call ShowWindow with this flag to set the initial show state of its main window.
SW_SHOWMAXIMIZED Activates the window and displays it as a maximized window.
SW_SHOWMINIMIZED Activates the window and displays it as a minimized window.
SW_SHOWMINNOACTIVE Displays the window as a minimized window. The active window remains active.
SW_SHOWNA Displays the window in its current state. The active window remains active.
SW_SHOWNOACTIVATE Displays a window in its most recent size and position. The active window remains active.
SW_SHOWNORMAL Activates and displays a window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when displaying the window for the first time.
Return Values
Returns a value greater than 32 if successful, or an error value that is less than or equal to 32 otherwise. The following table lists the error values. The return value is cast as an HINSTANCE for backward compatibility with 16-bit Microsoft® Windows® applications. It is not a true HINSTANCE, however. The only thing that can be done with the returned HINSTANCE is to cast it to an integer and compare it with the value 32 or one of the error codes below.
0 The operating system is out of memory or resources.
ERROR_FILE_NOT_FOUND The specified file was not found.
ERROR_PATH_NOT_FOUND The specified path was not found.
ERROR_BAD_FORMAT The .exe file is invalid (non-Win32® .exe or error in .exe image).
SE_ERR_ACCESSDENIED The operating system denied access to the specified file.
SE_ERR_ASSOCINCOMPLETE The file name association is incomplete or invalid.
SE_ERR_DDEBUSY The DDE transaction could not be completed because other DDE transactions were being processed.
SE_ERR_DDEFAIL The DDE transaction failed.
SE_ERR_DDETIMEOUT The DDE transaction could not be completed because the request timed out.
SE_ERR_DLLNOTFOUND The specified dynamic-link library was not found.
SE_ERR_FNF The specified file was not found.
SE_ERR_NOASSOC There is no application associated with the given file name extension. This error will also be returned if you attempt to print a file that is not printable.
SE_ERR_OOM There was not enough memory to complete the operation.
SE_ERR_PNF The specified path was not found.
SE_ERR_SHARE A sharing violation occurred.
Remarks
This method allows you to execute any commands in a folder's shortcut menu or stored in the registry.
To open a folder, use either of the following calls:
ShellExecute(handle, NULL, path_to_folder, NULL, NULL, SW_SHOWNORMAL);
or
ShellExecute(handle, "open", path_to_folder, NULL, NULL, SW_SHOWNORMAL);
To explore a folder, use:
ShellExecute(handle, "explore", path_to_folder, NULL, NULL, SW_SHOWNORMAL);
To launch the Shell's Find utility for a directory, use:
ShellExecute(handle, "find", path_to_folder, NULL, NULL, 0);
If lpOperation is NULL, the function opens the file specified by lpFile. If lpOperation is "open" or "explore", the function will attempt to open or explore the folder.
To obtain information about the application that is launched as a result of calling ShellExecute, use ShellExecuteEx.
See Also
IShellExecuteHook
Requirements
Windows NT/2000: Requires Windows NT 3.1 or later.
Windows 95/98/Me: Requires Windows 95 or later.
Header: Declared in Shellapi.h.
Import Library: Shell32.lib.
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.
|
|
|
|
|
CString strFileName("c:\hello.exe");
ShellExecute(NULL, _T("open"), strFileName, NULL, NULL, SW_SHOW);
|
|
|
|
|
|
It depends on how much control you want over the running process. You could use
WinExec
ShellExecute
CreateProcess
Next, you can use one of the 16 available _spawn() variations, or one of the 16 available _exec() variations.
My advice is to buy a book about the Windows API and one about the C runtime library, and research your requirements.
|
|
|
|
|
Hi I began a course in visual c++ a little while ago and just started actual coding about 2 weeks ago. I have to make a simple dialog based program that calculates a paycheck total. Sounds easy but I havn't been given any calculation examplesfor dialog based therefore I'm stumped as to how to accomplish this task.
what i need is to get the entered text from 2 edit box's, multiply them together and display the total in a third edit box.
I'm embarrased to ask for help on something that seems so simple but i'm stumped. Thnx if anyone can help me out on this one.
|
|
|
|
|
GREETINGS Kron.
So you have 3 textboxes and 3 members- m_1, m_2, m_3(use MFC ClassWizard to create them). All members are int.
void CT1Dlg::OnOK()
{
UpdateData(true);
m_3=m_1*m_2;
UpdateData(false);
}
That's all.
Good Luck!
LOVE & PEACE to everyone
LOVE & PEACE to everyone
|
|
|
|
|
In a programe ,I want to display Windows Metafile ,but I'm failed to do it. So I want to get some help from here!
How can I display WINDOWS METAFILE
|
|
|
|
|
I'm trying to learn ATL and my project is a series of GDI+ graphics filters ( invert, colour, gamma, brightness, emboss, you get the idea ), so I want to create methods like this:
[id(1), helpstring("method DoInvert")] HRESULT DoInvert([in, out] Bitmap * i)
How can I do this ? How can I use COM to pass a Bitmap* into my method ? Is there a way of doing this so that I can still make it an ActiveX control to be used in VB ? Should I care ( i.e. can they access GDI+ anyhow ) ?
Thanks to all who respond....
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.
|
|
|
|
|
VB can't deal with a Bitmap* object. You mgiht try
[id(1), helpstring("method DoInvert")] HRESULT DoInvert([in, out] HANDLE hBitmap)
VB has certain data type restrictions. If you want your ActiveX to be compatible with VB then you have to use the proper data types in your interface. Look in the docs for a list.
VB can not access GDI+.
|
|
|
|
|
If you need your component to be accessible from VB, you are restricted to using types from the VARTYPE enum - long, IDispatch*, etc. See wtypes.h or MSDN for the full list.
--Mike--
http://home.inreach.com/mdunn/
Sometimes, arming yourself with a big pointy stake just won't do you any good.
|
|
|
|
|