|
|
I tried deriving a class and adding that support but still no go. I am using an ODBC driver because for some reason the Jet drivers don't support the options I need.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
I am using an ODBC driver because for some reason the Jet drivers don't support the options I need.
Maybe ODBC over Jet doesn't support these options either. Anyway, you need to reduce your problem to some simple case: can you SetData on simple table with 1 integer column? Are you sure you're calling SetStatus for each field in accessor?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
It might not be the same problem but I ran into this error yesterday. It turned out I had an identity column in the column map. It would return this error when calling setdata.
|
|
|
|
|
Does anyone know how to use DotNet controls in a MFC app?
Thanks, Italo S Weiss
|
|
|
|
|
hi all,
I have a word object I placed with in place activation. whenever escape is pressed it closes. the messages seems to ignore my handlers.
anyone has an idea?
thanks for the help,
Omri
|
|
|
|
|
I wish to use ofstream::seekp() to point and set
there the new EOF, but...
I tried:
{
ofstream o("blah.txt", ios::in | ios::out);
o.seekp(-30L, ios::end);
//set the ptr 30 bytes back from EOF.
//I want to set (the new) EOF HERE!
}
10x.
|
|
|
|
|
I think you're better off telling us what you're trying to accomplish. I'm sure there's another way to solve the problem. Trying to set the EOF yourself is a losing proposition.
|
|
|
|
|
In another words, I wish to shorten the file, in 'n' bytes.
I wish to delete a stream of a known size and position,
from the end of the file.
Thanks again!
*** Bar Cochva _@_y ***
|
|
|
|
|
I'm coding in Borland C++ Builder 5...
I want to change what the executable name is when my project compiles.
Also I want to be able to have my program centered on screen when it's
compiled, so when people use it with different resolutions and what not, it's still starts in the center of the screen.
Any help would be much appreciated.
Thanks,
Aaron
|
|
|
|
|
First one is set in PRoject/Settings/Link, the second is CenterWindow();
Christian
#include "std_disclaimer.h"
The careful application of terror is also a form of communication.
Eagles may soar, but weasels don't get sucked into jet engines.
|
|
|
|
|
Perhaps i have a problem with my brain, but i would like to know if the a default constructor must do sthing. I explain what i mean.
In my application, i have created a class where of course there is a constructor, mine is a default constructor. I don't need to create an object which will be initialize to something, i just want to have some methods which do calculations..., so in my code .cpp, i put nothing between curly brace for the definition of the constructor. Is it good or not?
thanks in advance
gerald
|
|
|
|
|
if the ctor does nothing, then dont bother coding one, the compiler will do it for you.
|
|
|
|
|
Greetings!
I know for a fact that you can not call the SendMessage function from CDocument since it is not derived from CWnd. But is there any other way
to get around this?
In the ff. example I would like to use CDocument instead of CView:
--------------------------------------------------------------------
LRESULT CMainFrame::OnDialogDestroyed (WPARAM wParam, LPARAM lParam)
{
CView* pView = GetActiveView();
pView->SendMessage(WM_USER_DIALOG_DESTROYED, wParam, lParam);
return 0;
}
--------------------------------------------------------------------
Many thanks!
|
|
|
|
|
use the SDK version SendMessage(HWND , UINT, ...)
and use the handle for your frame window (CFrameWnd).
From there, when the message is received, route it to
the doc (call a document function, whatever).
|
|
|
|
|
I'm used to Borland, where you can just drop a tab control in the visual environment, then select each tab in turn and drop controls onto the tabs just like you do with a normal dialog. It doesn't seem possible to do this with VC++, or have I missed something? Can anyone point me in the direction of a simple guide to creating a tabbed dialog app?
Dave
Dave
|
|
|
|
|
I had used Borland once and the list of things that could not be done was too long.
Borland == Visual Basic for C++
Anyway, no you can't drop controls on the seperate tabs (at least that I'm aware of). You would have to place them in the dialog editor and then handle the change tab message to show or hide the appropriate controls.
|
|
|
|
|
|
Good point. I thought about PropertySheet/PropertyPage after I hit submit.
|
|
|
|
|
The solution described in this article doesn't use propsheets or proppages, no matter how they titled it. They just create a tab control and host child dialogs inside ('real' propsheet uses similar method). When tabs are clicked, hosted dialog is replaced by another 'page'.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hello,
I want to create my mainframe with a certain size. Right now I have overridden CMainFrame::PreCreateWindow and I set the members of the CREATESTRUCT x,y,cx and cy to hardcoded values.
I would however like to do this properly, by using AdjustWindowRect(Ex) to calculate the values for me.
The whole point is I want the client area to be of zero height, like the Visual Basic development environment used to be.
I cannot make this work. Here is my code:
BOOL COptixFrmMain::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style &= ~WS_MAXIMIZEBOX;
// cs.style &= ~WS_THICKFRAME;
// cs.style &= ~WS_SYSMENU;
/* These values are the ones I want!
cs.x = 0;
cs.y = 0;
cs.cx = 450;
cs.cy = 105;
*/
RECT rect;
SetRectEmpty(&rect);
rect.right = 450; // I want it to be 450 wide
::AdjustWindowRect(&rect,cs.style,TRUE);
cs.x = 0;
cs.y = 0;
cs.cx = rect.right - rect.left;
cs.cy = rect.bottom - rect.top;
cs.lpszClass = AfxRegisterWndClass(
CS_DBLCLKS, // if you need double-clicks
NULL, // no cursor (use default)
NULL, // no background brush
AfxGetApp()->LoadIcon(IDR_MAINFRAME)); // app icon
ASSERT(cs.lpszClass);
if( !SECFDIFrameWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
If you look carefully, you can see that I use Objective Toolkit, and their FDI classes, but that should hardly matter in this case.
All help is appreciated!
************************
Peter Andersson
peter.andersson@dtsag.ch
|
|
|
|
|
Objective Toolkit should hardly matter. You would be surprised. We gave up on using Stingray for our projects because they had so many features we had to work around. I recently had another project that used a Stingray tree control that gave some strange runtime errors. I eventually tracked it to the fact that while I expected a NULL to be returned in some cases it was not. I took Stingray out of the picture and everything worked perfectly.
|
|
|
|
|
I think you are right. A small testprogram shows that AdjustWindowRect does not understand the StingRay tear-off menu.
However, the std MFC testprog works fine, except for not noticing the toolbar. How do I find the height of that one?
Peter
************************
Peter Andersson
peter.andersson@dtsag.ch
|
|
|
|
|
You can use the following VB Script to create a project:
Set objMSDEV = WScript.CreateObject("msdev.application")
objMSDEV.addproject "test","c:\myapp",TRUE
objMSDEV.ActiveProject.AddFile "test.cpp"objMSDEV.QuitWScript.Echo "Done"
From this I have determined that the following C++ code should also generate a project:
#include "stdafx.h"
#include <stdio.h>
#include <atlbase.h>
extern CComModule _Module;
#include <atlcom.h>
#include <initguid.h>
#include <comdef.h>
#include <ObjModel\appauto.h>
#include <ObjModel\appdefs.h>
#include <ObjModel\appguid.h>
#include <ObjModel\bldauto.h>
#include <ObjModel\bldguid.h>
#include <ObjModel\blddefs.h>
#include <ObjModel\textauto.h>
#include <ObjModel\textguid.h>
#include <ObjModel\textdefs.h>
#include <ObjModel\dbgauto.h>
#include <ObjModel\dbgguid.h>
#include <ObjModel\dbgdefs.h>
IApplication *pApp;
int main(int argc, char* argv[])
{
HRESULT hr = CoInitialize(NULL);
if(FAILED(hr))
{
printf("Failed to initialize the COM libraries\n");
return FALSE;
}
hr = CoCreateInstance(CLSID_Application, NULL, CLSCTX_LOCAL_SERVER, IID_IApplication, (void**)&pApp);
if(FAILED(hr))
{
printf("Failed to create an instance of MSDEV\n");
CoUninitialize();
}
CComBSTR bProjectName("project");
CComBSTR bPath("c:\\myproject");
CComBSTR bType("Application");
VARIANT_BOOL bCreateDirs=VARIANT_FALSE;
pApp->AddProject(bProjectName,bPath,bType,bCreateDirs);
pApp->Quit();
pApp=NULL;
CoUninitialize();
return 0;
}
The problem is the call to add the project generates the following error:
Debug Error!
Program: test.exe
Module:
File: i386\chkesp.c
Line: 42
The value of ESP was not properly saved accross a function call.
This is usually a result of calling a function declared with one
calling convention with a function pointer declared with a different
calling convention.
Can any body tell me what I am doing wrong?
Thanks for any help you can provide.
Steve.
|
|
|
|
|
I don't see a pApp->Release() call being made. Not sure if that's the problem though....
HTH
Jignesh
|
|
|
|