|
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..
|
|
|
|
|
I got a problem with the STL.
It seems like the names coming from the STL are to long for the browse information.
So I need a easy method to get rid of the warnings because they are about 100 and still growing.
c:\programme\microsoft visual studio\vc98\include\list(176) : warning C4786: '?rbegin@?$list@PAVCOCIStatementHandle@@V?$allocator@PAVCOCIStatementHandle@@@std@@@std@@QAE?AV?$reverse_bidirectional_iterator@Viterator@?$list@PAVCOCIStatementHandle@@V?$
allocator@PAVCOCIStatementHandle@@@std@@@std@@PAVCOCIStatementHandle@@AAPAV4@PAPAV4@H@2@XZ' : identifier was truncated to '255' characters in the browser information
i:\eldis3\bib_source\eurotools\eflist.h(45) : see reference to class template instantiation 'std::list<class cocistatementhandle="" *,class="" std::allocator<class="" *=""> >' being compiled
i:\eldis3\bib_source\dbaccess\ocidatabase.h(147) : see reference to class template instantiation 'EFList<class cocistatementhandle="" *="">' being compiled
Thank you
|
|
|
|
|
put this line just before you #include the STL headers:
#pragma warning(disable:4786)
likewise, you can suppress any warning by just changing the number in this pragma.
-c
|
|
|
|
|
You could try to put the following line at the start of the source file.
#pragma warning(disable:4786)
This only works for the Microsoft C++ compiler. But beware - this doesn't always work. This is a bug in the compiler - Microsoft admit to this - see this link: http://support.microsoft.com/support/kb/articles/Q167/3/55.ASP.
So - no help from Microsoft here.
Good Luck.
|
|
|
|
|
hi
please tell me
good bye
|
|
|
|
|
Take a look at the ATL string conversion macros. Try something like:
USES_CONVERSION;
CComBSTR bstrText(_T("String to convert"));
TCHAR* asciiText = W2T(bstrText);
Note that this uses TCHAR* instead of char* so that you can compile as unicode. Use W2A if you want to use ASCII explicitly. These functions allocate storage on the stack so don't try to access the converted string outside local scope - copy it if you want to return it from a function.
|
|
|
|
|
|
I am trying to create a type library for a 16-bit dll, but I am getting a compile error from MkTypLib.
The error message is:
fatal error M0001: Syntax error near line 9 column 29: unknown type
According to: http://msdn.microsoft.com/library/books/inole/S111F.HTM, the problem seems to be "caused by mismatched OLE DLLs".
My ODL file is:
#define PASCAL pascal
[uuid(9CE95330-3640-11d4-A110-0000C50D034E)]
library ZAPIlibrary {
[dllname("ZAPI.DLL")]
module ZAPImodule {
[entry("zapiGetVersion")]
DWORD PASCAL zapiGetVersion([in] WORD Component, [out] DWORD *Version);
};
};
The error is in the area near the end of "[entry("zapiGetVersion")]". I have tried other things and the exact position of the error varies depending upon what else is in the line but is always close to but before the closing bracket. I have tried adding other attributes such as helpsting after the entry attribute and the column specifed by the error message moves to the end of the other attributes, indicating that it is not really the entry attribute that is a problem.
I am using the following make file:
ZAPILib.tlb : ZAPILib.odl
MkTypLib /D "WIN16" /win16 ZAPILib.odl
I loaded a fresh copy of NT yesterday and still got the error. If anyone can tell me that my ODL file should work as-is for MkTypLib, then I will know that I need to search further for whatever the problem is in my system.
Thank you.
|
|
|
|