|
Hello everyone !!!
Where can i find nice examples and tutorials about using Office Automation like Excel and Word ???
Regards,
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Well, there's at least one sample which comes with Visual C++ - look for COMEXCEL.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Hi,
I have written a file packer for a game engine. The packer uses Zip compression (based on the zlib library), and so any packed files can easily be opened with WinZip, EnZip etc. However, I would like to give them better protection. Currently they can be password protected (and the password is encrypted), so people can open the zip file but not extract any of the contents. However, I was wondering if there was any way to make the Zip file unreadable to WinZip etc and only readable to my program.
Any suggestions would be much appreciated.
Many thanks,
KB
|
|
|
|
|
Create an unprotected .zip with dummy name containing all files and zip it again with a password. Users will be able to see one filename in protected .zip.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
or, mangle the data as you write it to the file.
very simple way would be to pick a random DWORD, and xor every 4 bytes with it. This should screw the thing up enough that winzip won't make head or tail of it.
Then, as you read it, xor again with the same number to get back to where you started.
STL is a religeon. Enquiries to Reverend Christian Graus
|
|
|
|
|
Thanks both for your replies - I think I may well try to change the way it writes, as Jon Hulatt suggests. This will obviously mean writing my own packer utility too (I was using WinZip to pack and then my own program only needed to unpack), but that shouldn't be too bad.
Thanks again,
KB
|
|
|
|
|
no need. pack with winzip, just write a quick program that opens your zip file and writes a new mangled one.
STL is a religeon. Enquiries to Reverend Christian Graus
|
|
|
|
|
I added exactly this capability to zziplib some time ago.
|
|
|
|
|
|
EnumFontFamiliesEx gives you NEWTEXTMETRIC for each font. NEWTEXTMETRIC::ntmFlags has flags which may help you determine if font is OpenType or not.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
i am actually a C# programmer, i need to find out the type, but i dont really want to cann enumfontfamiliesex as there is a .net collection to get the fonts, but if i cant get the font type, then i suppose ill have to use this instead to enumerate fonts.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
I tried EnableMenuItem to disable a menu. It's not working the menu always ramains enabled. Why
|
|
|
|
|
I'm assuming you're using MFC. MFC calls EnableMenuItem for you - you need to provide ON_UPDATE_COMMAND_UI handlers for menu items you want to enable/disable/check/uncheck.
You don't need ON_UPDATE_COMMAND_UI handlers for menu items which stay enabled all the time.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
|
Hi, i'm working with a CListCtrl, i would like that when the user clicks on it, to hide the selection.
I couldn't find a style that could do it for, (there is that option with CListBox), so i did like :
void CBy_City::OnNMClicklsccity(NMHDR *pNMHDR, LRESULT *pResult)
{
POSITION p = m_lscCity.GetFirstSelectedItemPosition();
int Select = m_lscCity.GetNextSelectedItem(p);
m_lscCity.SetItemState(Select,~LVIS_SELECTED,~LVIS_SELECTED);
}
The last two arguments of SetItemState are obvisously wrong, but i don't know how to deny those constants...
Thank you for your time
rui
|
|
|
|
|
One line:
m_lstCity.SetItemState(-1, 0, LVIS_SELECTED);
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Thank you Tomasz,
It works, but it is still possible to see that that item was clecked, is there a way that it never happends?
Thank you once more
rui
|
|
|
|
|
Use LVIS_SELECTED | LVIS_FOCUSED instead of LVIS_SELECTED.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Well, it is still possible to see that the user tried to select an item, thank you the same.
rui
|
|
|
|
|
Hello,
i wrote an mdi-app with c++/mfc under winnt 4.0. When logging off the current user from winnt, winnt closes all running apps before the login-dialog will be displayed. This works correct for all apps i tested, but when winnt wants to close my app before logging off, the explorer crashes. it seems that the app closes the right way, because no debug-message created by my app is missing in the corresponding debug-file. Where is the difference between closing an app by hand and closing an app automatically by winnt before logging off ? And why can my app cause the explorer to crash ? Please help me, i don't know a way to fix this
Best regards
tabor25
|
|
|
|
|
You might want to try handling the messages WM_QUERYENDSESSION and WM_ENDSESSION . They are sent to all running applications during the shutdown process.
Gary R. Wheeler
|
|
|
|
|
I have a static control with the bitmap style and the notify style set.
I have an on click handler as well
ON_STN_CLICKED(IDC_LANG, OnStnClickedStaticlang)
void CRegularDialerDlg::OnStnClickedStaticlang()<br />
{<br />
.....<br />
m_langstatic.SetBitmap(LoadBitmap(NULL,<br />
MAKEINTRESOURCE(IDB_BITMAP5)));<br />
.....<br />
}
Now as you can see the only thing I do is to change the bitmap [the rest of
the code has nothing to do with the static control]
Now my problem is that the on click does not work anywmore [as if it lost
the notify style bit somehow]
I used Spy++ and found that after one click it won't accept this static
control as a window (( [means I cant drag the cross and select this
control]
has anyone else encountered this issue? Is this some kinda bug?
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
You're passing NULL as 1st argument to ::LoadBitmap. ::LoadBitmap fails. CStatic::SetBitmap (which is just a wrapper over STM_SETIMAGE) gets NULL bitmap and sets the size of control to 0x0 pixels.
You need to pass AfxGetResourceHandle() to LoadBitmap, or, better yet, use CBitmap::LoadBitmap.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|
|
Tomasz Sowinski wrote:
You're passing NULL as 1st argument to ::LoadBitmap. ::LoadBitmap fails
Hmmm. Tomasz, can you take a look at this URL :-
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_cstatic.3a3a.setbitmap.asp
and scroll down to the example :-
[I copy/paste below for your convenience]
Example
CStatic myStatic;
myStatic.Create(_T("my static"),
WS_CHILD|WS_VISIBLE|SS_BITMAP|SS_CENTERIMAGE, CRect(10,10,150,50),
pParentWnd);
myStatic.SetBitmap( ::LoadBitmap(NULL, MAKEINTRESOURCE(OBM_CHECK)) );
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
Nish,
You seem to not believe in my explanation
Anyway, the LoadBitmap call with NULL in the example loads so-called OEM bitmap embedded in one of Windows modules. OBM_CHECK is special, predefined identifer. Obviously, you're loading your own bitmap, not the OEM one. That's why you need non-NULL as first argument to LoadBitmap call.
Read the LoadBitmap docs for more details.
Tomasz Sowinski -- http://www.shooltz.com
** Putt knot yore thrust inn spel chequers. **
|
|
|
|