|
I found out how to turn my MDI into a text interface, but using this:
#include <afxrich.h>
class CFDPViewRE : public CRich2EditView
{
protected:
CFDPViewRE(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CFDPViewRE)
public:
virtual void OnInitialUpdate();
protected:
virtual ~CFDPViewRE();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
DECLARE_MESSAGE_MAP()
};
For some damn reason, it by default is always bold, if I write in comands for a bold button, then you can highlight text and un bold it, or click the bold button and type non bold text, but when you open the program, the bold button is already checked. I take out all of the code for bold from my program, and still the text is bold. Therefor I started from scratch. The above is all I have really other than the supporting .h file that has no refrences whatsoever to bold or weight or font. I for the life of me can't figure out how to get it so it isn't bold font. Maybe I need to use another type of text thing other than rich text, but I don't know much about this stuff yet. Any ideas?
LOSTTWARE.com
|
|
|
|
|
how can i get the format of file *.wab (address book)
|
|
|
|
|
Easy check this console app out, It will explain all.
// main.h
#include <<windows.h>> //sorry for the double but I could not get singles to take.
#include <<crtdbg.h>>
#include <<iostream.h>>
#include <wab.h>
typedef HRESULT (WINAPI *fWABOpen)(LPADRBOOK*,LPWABOBJECT*,LPWAB_PARAM,DWORD);
int main()
{
HRESULT hRes;
LPADRBOOK lpAdrBook;
LPWABOBJECT lpWABObject;
LPWAB_PARAM lpWABParam = NULL;
DWORD Reserved2 = NULL;
HINSTANCE hinstLib;
hinstLib = LoadLibrary("C:\\Program Files\\Common Files\\System\\wab32");
fWABOpen procWABOpen;
if (hinstLib != NULL)
{
procWABOpen = (fWABOpen) GetProcAddress(hinstLib, "WABOpen");
if (procWABOpen != NULL)
{
hRes = (procWABOpen)(&lpAdrBook,&lpWABObject,NULL,Reserved2);
_ASSERTE(hRes == S_OK);
if (hRes != S_OK) exit(1);
//lpWABObject->Find(lpAdrBook,NULL);
ULONG lpcbEntryID;
ENTRYID *lpEntryID;
hRes = lpAdrBook->GetPAB(
&lpcbEntryID,
&lpEntryID
);
_ASSERTE(hRes == S_OK);
if (hRes != S_OK) exit(2);
ULONG ulFlags = MAPI_BEST_ACCESS;
ULONG ulObjType = NULL;
LPUNKNOWN lpUnk = NULL;
hRes = lpAdrBook->OpenEntry(
lpcbEntryID,
lpEntryID,
NULL,
ulFlags,
&ulObjType,
&lpUnk
);
ulFlags = NULL;
//IABTable *lpTable;
if (ulObjType == MAPI_ABCONT)
{
IABContainer *lpContainer = static_cast <iabcontainer *="">(lpUnk);
LPMAPITABLE lpTable = NULL;
hRes = lpContainer->GetContentsTable(
ulFlags,
&lpTable
);
_ASSERT(lpTable);
ULONG ulRows;
hRes = lpTable->GetRowCount(0,&ulRows);
_ASSERTE(hRes == S_OK);
cout << "Rows " << ulRows << endl;
SRowSet *lpRows;
hRes = lpTable->QueryRows(
ulRows, // Get all Rows
0,
&lpRows
);
for(ULONG i=0;i<lprows->cRows;i++)
{
SRow *lpRow = &lpRows->aRow[i];
cout << i << " : " << lpRow->cValues << endl;
for(ULONG j=0;j<lprow->cValues;j++)
{
SPropValue *lpProp = &lpRow->lpProps[j];
cout << "\t" << j << " : " << (void*)lpProp->ulPropTag << " : ";
if (lpProp->ulPropTag == PR_DISPLAY_NAME_A)
cout << "Display Name: " << lpProp->Value.lpszA;
if (lpProp->ulPropTag == PR_EMAIL_ADDRESS_A)
cout << "Email Address: " << lpProp->Value.lpszA;
if (lpProp->ulPropTag == PR_NICKNAME_A)
cout << "Nickname: " << lpProp->Value.lpszA;
if (lpProp->ulPropTag == PR_ADDRTYPE_A)
cout << "Addrtype: " << lpProp->Value.lpszA;
cout << endl;
}
lpWABObject->FreeBuffer(lpRow);
}
lpWABObject->FreeBuffer(lpRows);
}
}
FreeLibrary(hinstLib);
}
return 0;
}
Best Wishes,
ez_way
|
|
|
|
|
This site keeps a list of many file formats.
http://www.wotsit.org/[^]
Roger Allen
Sonork 100.10016
Death come early, death come late,
It takes us all, there is no reason.
For every purpose under heaven,
To each a turn, to each a season.
A time to weep and a time to sigh,
A time to laugh and a time to cry,
A time to be born and a time to die.
Dust to dust and ashes to ashes,
And so I end my song.
|
|
|
|
|
Hello,
I need to play an avi file in my program using the media player activex control.I need to be able to indicate a starting frame and an end frame that the control will stop playing after reaching it.
Thanks in advance
|
|
|
|
|
Hail, dear colleagues.
I have a question about object identity.
Let's say I need to make an array of some objects. These objects (classes) will be defined by users of the library. So, I have to provide a base class with an interface and create an array of these objects. It's clear.
But when user creates a derived class and wants to get an object from the array, he should know about type of this object to be able to cast it back, because in this array objects of different types can be stored.
So, the question is, how to define identity of derived class? Should I implement something like IsKindOf() method and use runtime identification, like in MFC, or there are other ways to do so?
I have to mention that the only extension, which can be used, is STL. No MFC, nor any other platform depended libraries.
Thank you in advance for any suggestions.
|
|
|
|
|
Hail to you too, comrade.
The C++ standard provides something to solve this in the form of Run-Time Type Information (RTTI). For a starter you can look here[^]
|
|
|
|
|
I need to get all mountpoints of a partition (like D:\)
What i have is the physical drive id (e.g. "\\.\PhysicalDrive0") and the partition id.
The problem is that that i need to find out the unique volume name in the form "\\?\Volume{GUID}\" in order to be able to use the VolumeManagement functions. The problem is that i don't have the partition's drive name name and drives don't even have to be mounted. So what can i do to get the partition's GUID?
I could do it using DeviceIoControl with IOCTL_DISK_GET_PARTITION_INFO_EX but that's only XP and later and i need it to be working on 2k too.
If anyone has an idea, please let me know
Regards
webseek
|
|
|
|
|
Hi can u please tell me how to create ico file or what structure it has?
Thanks
|
|
|
|
|
Visual C++ 6.0 can create them, or a graphics prog like Xnview http://www.xnview.com/[^]
Try www.wotsit.org[^] for the ICO file format
"The greatest mistake you can make in life is to be continually fearing you will make one." - Elbert Hubbard
|
|
|
|
|
Thx, but i need to do this manually in my program.
|
|
|
|
|
In that case look at wotsit.org for the ICO file format and DIY or serch for a freware library.
"The greatest mistake you can make in life is to be continually fearing you will make one." - Elbert Hubbard
|
|
|
|
|
Thanks 
|
|
|
|
|
I use EnumDisplaySettingsEx in my program,but it doesn't work ,just say undefined.
I think it maybe require defining of winver 0x0500,but it is still not work after I added the definition.
please give me some suggestion or sample .
thank you!
Happy Gemini
|
|
|
|
|
What kind of OS do you have?
I created a simple win32 app and put the following code in InitInstance.
DEVMODE xDeviceInfo;
xDeviceInfo.dmSize = sizeof(DEVMODE);
EnumDisplaySettingsEx(NULL, ENUM_CURRENT_SETTINGS, &xDeviceInfo, 0);
Works without any problems, gives device name and all current vmode related info.
On W2K, VS.NET 2003
Hope it'll help.
|
|
|
|
|
My application is based on win2k + VC6.
someone suggestion me to download latest version of the SDK,but I don't know which one I should download,please give me some suggestion or link if you know.
Happy Gemini
|
|
|
|
|
Download the latest Platform SDK.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hi!
I am trying to use checkboxes in a CListCtrl. To simplify handling of the control, I've written the following short code:
void CGeneratorDlg::_SetCheck(int inxItem, BOOL bEnable)
{
LV_ITEM _ms_lvi;
_ms_lvi.stateMask = LVIS_STATEIMAGEMASK;
_ms_lvi.state = (UINT)(((int)(bEnable) + 1) << 12);
m_cList.SendMessage(LVM_SETITEMSTATE, (WPARAM)inxItem,
(LPARAM)(LV_ITEM FAR *)&_ms_lvi);
}
BOOL CPwGeneratorDlg::_GetCheck(int inxItem)
{
return ((((UINT)(m_cList.SendMessage(LVM_GETITEMSTATE, (WPARAM)inxItem,
LVIS_STATEIMAGEMASK))) >> 12) - 1);
} Those 2 functions seem to work nice but unfortunately when I call them in the OnInitDialog function they do nothing:
for(int i = 0; i < m_cList.GetItemCount(); i++)
_SetCheck(i, TRUE); This should check all checkboxes in the list. I do this in OnInitDialog function but it does just plain nothing. The checkboxes remain unchecked.
Any idea how to check the checkboxes in OnInitDialog?
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
|
I tried it, set the struct to zero, and it doesn't change anything The boxes remain unchecked.
Any more idea?
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
IIRC there was a problem with list view controls SetCheck not working in OnInitDialog (and maybe in OnCreate too). Try posting yourself a message, and do the SetCheck's there.
"Vierteile den, der sie Hure schimpft mit einem türkischen Säbel."
mlog || Agile Programming | doxygen
|
|
|
|
|
peterchen wrote:
Try posting yourself a message, and do the SetCheck's there.
Err... sorry, but what do you mean with that? In my SetCheck function I send the message directly to the control using the SendMessage function...
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Sorry, a bit more detailed:
In OnInitDialog, do a PostMessage(dialog, WM_APP, 0, 0);
Add a handler for WM_APP to the dialog, and do the SetCheck's there.
"Vierteile den, der sie Hure schimpft mit einem türkischen Säbel."
mlog || Agile Programming | doxygen
|
|
|
|
|
dear all
can anyone point me how can delete directories with files, folders.
thanx and regards
rIsHaBh
|
|
|
|
|
You can either use the shell functions (like Windows Explorer) or do it like this:
http://www.codeproject.com/file/removefiles.asp[^]
Hope this helps
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|