|
It does work with my "Release MinDependency" build! But it couldn't solve the problem within my "Release MinSize" build. What should I do?
Thanks,
Tony
|
|
|
|
|
Hi,
You MUST remove the preprocessor option ATL_MIN_CRT from ALL release builds, not only from "Release MinDependency".
Regards,
Alex Gorev,
Dundas Software.
|
|
|
|
|
I am using CDaoDatabase and related classes to work with an MS-Access database. I need to do
replication and synchronization with this database. I need to synchronize between this database on a
local machine, and with it on a network drive. For some reason it does not want to work. It tells me
that "the database is not found." It does not tell me which one. I know for a fact that both of them
do exist.
The first thing that needs to be done is make sure that both databases have the "Replicable"
property. If this property does not exist, I need to create it. It is at this point that I already
have problems. Here I get a "Data type conversion error." This what my code looks like:
bool CMyDatabase::CreateDBProperty(CString sProperty)
{
DAOProperty *pdp;
DAOProperties *pdps;
bool bRet = false;
COleVariant vntName( sProperty );
COleVariant vntType(( short )VT_BSTR );
COleVariant vntValue( "T" );
COleVariant vntbDDL(( long )FALSE );
// m_daoDB is a DAODatabase (from CDaoDatabase::m_pDAODatabase)
HRESULT hr = m_daoDB->CreateProperty(
vntName,
vntType,
vntValue,
vntbDDL,
&pdp );
// hr result is 0x800A0D5D (3421)
// "Data type conversion error."
}
Does anyone have any ideas or help?
I would appreciate it!
|
|
|
|
|
If someone can explain the following I would appreciate it.
I have a simple Tree control in which I need to associate data with individual items in the tree. The 32 bit LParam seems like an easy place to place an identifier that I can then use to lookup the assoicated data in a secondary array (or what ever). When I try to directly use this field it appears to always be blank (zero). But when I use the SetItemData function with the item handle returned in from the InsertItem function all works fine.
HTREEITEM pItem = m_ProdTree.InsertItem("My Text",pRoot,NULL);
DWORD MyNum=nnn;
m_ProdTree.SetItemData(pPar,MyNum);
Doesn't the SetItemData/GetItemData use the LParam field??
Thanks Mike
|
|
|
|
|
Maybe you have not set the flags in the TVITEM structure correctly?
Try to debug into the SetItemData() member function and look how MFC does it. Then you can do it the same way.
|
|
|
|
|
|
Just to document: I was not setting the mask correctly. I had just set the mask to TVIF_TEXT and had not added the TVIF_PARAM.
TVINSERTSTRUCT MyInsert;
MyInsert.hParent=NULL;
MyInsert.hInsertAfter=NULL;
MyInsert.item.mask=TVIF_TEXT|TVIF_PARAM; // <<< HERE
// The mask defines what is valid !!
MyInsert.item.pszText=_T("A->Root");
MyInsert.item.lParam=(LPARAM)MyDataValue;
HTREEITEM TVI_MyItem =
m_Tree.InsertItem(&MyInsert);
|
|
|
|
|
First of all excuse my english... (I'm just a begginer)
I've posted a question about serializing Data structures and I have followed the instructions of the scribble sample, but I get an error when loading data from disk.
My data structures are these ones:
struct STRCTxDATA { this struct contains BOOL, int, HANDLE, DCB, CString, COMMTIMEOUTS, UINT... };
struct STRCTxTEXT { This struct contains only CStrings... };
struct WRKSTRCTS // To ensure that the two structures are linked...
{
STRCTxDATA *WRKSTRCTDADES;
STRCTxTEXT *WRKSTRCTDESCRIPCIONS;
};
Now I would like to save/load those structures... (they are used to create a configuration file for the communication devices)
NOTE: those structures are placed in a CArray.
void CGenCFGDoc::Serialize(CArchive& ar)
{
int iItemCounter = 0;
char chSeparator = '\0';
m_bModified = FALSE;
if (ar.IsStoring())
{
ar << ArrayxCFG.GetUpperBound() + 1;
ar << chSeparator;
}
else
{
ar >> iItemCounter;
ar >> chSeparator;
}
ArrayxCFG.Serialize(ar);
TRACE ("\nSERIALIZATION RESULTS:\n----------------------\n# Items: %i\n",iItemCounter);
for (int iCounter = 0; iCounter <= ArrayxCFG.GetUpperBound(); iCounter++)
{
TRACE("%s\n",ArrayxCFG[iCounter].WRKSTRCTDADES->csCadDCB); // <<-- Here I got the error.
}
}
Could you help me?
Thank you in advance...
|
|
|
|
|
I need to display video from a camera in my MDI app. I'll have a menu item 'Video' and when the user selects it, a window will open displaying the incoming video.
Question:
Does anyone know where I can find info on how to do this?
I would like to develop the code so that any Windows compatible capture card would work. Should I use MCI commands or is there something more.. modern?
Thanks for any suggestions.
|
|
|
|
|
No, don't use MCI. You should use DirectShow for this. It is in fact very easy to do what you request, and DShow comes with a sample app which does just that (render relatime capture to an HWND).
DShow is part of the DirectX SDK. I don't think it's available for download anymore. You may have to order the SDK on a CD (for a nominal fee).
Good luck!
|
|
|
|
|
i think that mci was the last modren.see avicap class of VC but it doesn't work in invisible mode.all other thing it is capble of
bobbies_2001@yahoo.com
|
|
|
|
|
First of all excuse my english level, I'm just a begginer...
I must develop a program that can edit files and send them using serial ports.
In order to edit those files I've tought about using CRichEditViews in an MDI App.
Doing this I've found that the RichEdits need the OLE capabilities enabled...
Could I disable them? or there is another way (or control) that let me edit files using "Syntax highlighting" without being able to receive an Excel spreadsheet or another OLE object?
Thank you in advance.
|
|
|
|
|
Why not create a SDI application in which your view class is derived from CFormView. Then you can insert a rich edit control on your form. If you choose this method there are a couple of things that you will need to consider:
1. Add the line
AfxInitRichEdit();
to the InitInstance function of your app class.
2. Remove the line
ResizeParentToFit();
from the OnInitialUpdate function of your view class.
3. In the OnInitialUpdate and OnSize functions of your view class to resize your rich edit window to fit your view class.
|
|
|
|
|
I am currently writing an app that uses multiple document types. When the user creates a new file, I would like the size of the generated child window to depend on the document type. If anyone has any suggestions on how to accomplish this, please let me know.
|
|
|
|
|
We need a bit more information. Are you using CFormView? What criteria do you want to use to determine the size used for each view?
|
|
|
|
|
I figured one way out already, but thanks for replying. The way I am doing it I have a seperate Child Frame class for each document type. Then i just modify the window's size in the Child Frame's PreCreateWindow function. If you know of a better way to accomplish this, though, feel free to let me know! Thanks again!
|
|
|
|
|
If you are using CFormView, probably you can use ResizeParentToFit() in your OnInitialUpdate().
|
|
|
|
|
I am using a HP-Jornada 420 Palm/PC and was wondering if it is possible to display the QWERTY keyboard (the one at the bottom of the screen) when I set focus on an edit box (or if the user presses an onscreen button).
I thought I saw a function call to display/hide the keyboard, but I can't find it - anybody help.
Joe.
|
|
|
|
|
This was posted on the CE mailing list a while back by David Baldauff:
#include <aygshell.h>
BOOL CInputPanel::Show(BOOL bShowThePanel)
{
SIPINFO siThePanel;
memset(&si,0, sizeof(siThePanel));
siThePanel.cbSize = sizeof(siThePanel);
if ( SHSipInfo( SPI_GETSIPINFO, 0, &siThePanel, 0))
{
if(bShowThePanel)
siThePanel.fdwFlags |= SIPF_ON;
else
siThePanel.fdwFlags &= ~SIPF_ON;
return SHSipInfo( SPI_SETSIPINFO, 0, &siThePanel, 0);
}
return FALSE;
}
|
|
|
|
|
Do I need to link in some library because when I compile the sample I get the following error:
--
Deleting intermediate files and output files for project 'TestCeDlg - Win32 (WCE SH3) Release'.
--------------------Configuration: TestCeDlg - Win32 (WCE SH3) Release--------------------
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
TestCeDlg.cpp
TestCeDlgDlg.cpp
Generating Code...
Linking...
TestCeDlgDlg.obj : error LNK2001: unresolved external symbol _SHSipInfo
WCESH3Rel/TestCeDlg.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
TestCeDlg.exe - 2 error(s), 0 warning(s)
--
Thanks for your help so far.
Joe.
|
|
|
|
|
Hello to all programmers out there !!!
I have a CListCtrl with 5 column headers and single select option. When I want to select a line I can
only use the first header. How can I make it so that when I click on the last header (or any of them) the line gets selected ???
Thanx in advance for any help
Have a nice day !
|
|
|
|
|
Set the full-row select style of the list control. Unfortunately, you can't set this in the dialog editor, so you have to do it with code:
mylist.SetExtendedStyle ( LVS_EX_FULLROWSELECT );
You need v4.70 or greater of the common controls for this to work.
|
|
|
|
|
Hello,
I need a fast algorithm to sort a CTypedPtrArray, that is, the pointers it
contains. Here is roughly the class which is stored in the Array. It's
called CClient:
class CClient{
public:
CClient();
~CClient();
ULONG GetID(){return m_ID;};
CString GetName() {return m_Name;};
private:
CString m_Name;
ULONG m_ID;
}
Now in my code I attach to a given datasource (which contains quite a large
amount of data) and start adding new CClients to the array. I would like to
know what is the most effective way to insert each new CClient pointer so,
that the items in the array are sorted descending by the m_ID member
variable of the CClient class.
Thank you for your time.
|
|
|
|
|
Hi,
This won't answer your question but why don't you just use the STL. The STL has some very efficient
sorting algorithms that I think you will find useful. If you don't know STL, I think you can get up to
speed in just a few hours. If I had to do anything like this I would prefer the STL over the MFC collections.
sayed
|
|
|
|
|
What is the best way to go about implementing a dropdown combobox as the edit mode in a listview? Ie. when the listview gets the LVN_BEGINLABELEDIT. Should I track the mouse position and create the combobox based off the mouse position? Should I go ownerdrawn? Or should I try and piggyback the combobox off the positions of the edit control. Thanks..
|
|
|
|