|
Is there a way that I can read the version info in the resource and display it in the about box?
Thanks
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Hi,
Have a look at
GetFileVersionInfoSize
GetFileVersionInfo
Regards,
Prem
|
|
|
|
|
Hi all, long time no see. I have a smallish problem that I just can't get my head round. I have installed Microsofts DirectX 7 SDK and want to start using it. I have updated the lib and include directories so they look in the appropriate places (i.e. where i installed the sdk). However, when I try to use DirectDrawCreateEx() with parameter 3 as IID_IDirectDraw7 I get two unresolved externals for the function and GUID. I've had a look at the include directory of the SDK, only header files? is that normal. Is it trying to access a lib and is failing for some reason??? why? why? why? Could someone please help or point me to a page that would help me.
Much appreciated,
Alan.
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
Hi all, I found the problem. For anyone who has a similar problem for unresolved externals do this:
1. Make sure you have the relevant lib and include directories (where you installed SDK) listed in Tools > Options > Directories menu (and are at top).
2. Go to Project > Settings > LINK > Object/Library Modules and add ddraw.lib and dxguid.lib. (btw. Microsoft recommends you do it this way as opposed to #include headers, honest it says on their web site in the DirectX SDK section).
You'll find the errors will magically disappear if you've done it correctly.
Alan.
"When I left you I was but the learner, now I am the master" - Darth Vader
|
|
|
|
|
Me again,
Can is Automate Outlook / Outlook Express in a way that I prepare a New Message, where:
* Receiver Address
* Message Body
* Attached file(s)
is already included?
Would be nice if I can do this for Netscape etc. as well.
The earth is not dying. It is being killed.
|
|
|
|
|
You can use MAPI. If you call MAPISendMail() with the MAPI_DIALOG flag set, it will display the message, ready to be sent in Outlook/Outlook Express/Whatever. I have no idea if it works for Netscape though.
---Shog9---
From now on we can call C# and MC++ "The square wheel languages" -- Jack Handy, The Lounge
|
|
|
|
|
Hi,
I'm looking for a C++ .lib (or sources) that can create an archive of multiple files - preferedly something that can be unpacked with winzip again.
It should be free, royalty-free, and no-strings-attached. good compression ratio is not that much an issue, but would be nice.
Data is a few text and binary files in a single folder (no subdirs (as of now)), from a few hundred bytes to usually < 2MB.
Is there anything like this?
The earth is not dying. It is being killed.
|
|
|
|
|
|
InfoZip should do what you want. It's (obviously) based on zlib.
|
|
|
|
|
Crypto++ includes Gzip and Zlib support as well as a bunch of great Crypto stuff. Highly recomended.
Neville Franks, Author of ED for Windows. www.getsoft.com
|
|
|
|
|
I am trying to write a function for a CFormView called BatchPrintPage2().. the first part of this function is trying to get a handle on HDC. This is before I try to get the hDC:
DOCINFO di ;
CPrintInfo printInfo ;
CMyDoc *pDoc = (CMyDoc*)GetDocument() ;
CString filename ;
CDC dc ;
CRect draw_area ;
ASSERT_VALID(pDoc) ;
filename = pDoc->GetPathName() ; // make sure the compares will match
filename.MakeLower() ;
CPrintDialog dlg(FALSE) ;
at this point i try to get the hDC, the first way i was told to try was:
HDC hDC = dlg.CreatePrinterDC() ;
but this always returns null.
the other way i have tried is:
dlg.GetDefaults();
HDC hDC = dlg.m_pd.hDC;
this actually seems to work.. but then i get to the rest of the function..
di.cbSize = sizeof(DOCINFO) ;
di.lpszDocName = pDoc->GetPathName() ;
di.lpszOutput = filename ; // prepare the print information structure
dc.Attach(hDC) ;
printInfo.m_bDirect = TRUE ;
printInfo.m_rectDraw.left = 0 ;
printInfo.m_rectDraw.right = dc.GetDeviceCaps(HORZRES) ;
printInfo.m_rectDraw.top = 0 ;
printInfo.m_rectDraw.bottom = dc.GetDeviceCaps(VERTRES) ;
draw_area = printInfo.m_rectDraw ;
dc.StartDoc(&di) ;
OnPreparePrinting(&printInfo) ; // start printing the document
for (printInfo.m_nCurPage = 1 ; printInfo.m_nCurPage <= printInfo.GetMaxPage() ; printInfo.m_nCurPage++)
{
dc.StartPage() ;
OnPrint(&dc, &printInfo) ;
dc.EndPage() ; // reset page size as OnPrint may have modified them when header / footers were added to the page
printInfo.m_rectDraw = draw_area ;
}
OnEndPrinting(&dc, &printInfo) ;
dc.EndDoc() ;
VERIFY(dc.DeleteDC()) ;
this doesn't give any errors, but nothing prints. When tracing i see that OnDraw is called, but IsPrinting() is false. I have tried setting dc.m_bPrinting = TRUE, and this makes onDraw get called with IsPrinting() true, but it still prints nothing. My printer queue actually shows the job being sent to the printer, but when i captured the screen and look at it the 'Pages' and 'Size' columns are both blank..
also a major problem is that the 'for' loop listed above corrupts the hell out of my document.. my document file just gets destroyed with garbage from this for loop.. the dc.StartPage() sets the file to the following: (does this look like its printing to the document file somehow?)
%-12345X@PJL ENTER LANGUAGE=PCL600
*t600R&u600D*r3F&l0O&l1H&l2a8c1E*p0x0Y&l1X*b0M
*v0o0TE%-12345X
any help is much appreciated.. i can almost smell printing a bunch of views without a dialog
thanks!
-dz
|
|
|
|
|
Further to my reply in your other thread.
Looking at the code, if your getting a valid DC then I would expect this to work. The first things to check are that you are setting the number of pages you want to print in the views OnPreparePrinting function. For testing I would by default set this to 1.
pInfo->SetMaxPage(1) ;
You will then know exactly how many times the loop will run for. The next thing is to check for the document corruption that is happening. Put a breakpoint at the start of the for loop, and try stepping over the function in it while viewing the pDoc object in the variables/watch window. If you see any of them change (turn red), then you will see in what procedure the corruption of your doc object is happening. I would most probably think that its the CView::OnPrint() or CView::OnDraw() procedures at fault. As this code you are using is a derivative of code I used for printing documents to a PDF file (where I get a DC for a PDF printer driver), I would expect all that to work without problems.
I just noticed that there is a call to CView::OnBeginPrinting() missing just before the for loop, this is probably what will set the m_bPrinting falg for OnDraw to work correctly. It may also do some other miscellaneous stuff to avoid the corruption that is happening.
If you have further problems, post some updated code and we can go from there. It may also help to post the OnDraw() code of your view.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
woop!
the whole problem was the line:di.lpszOutput = filename; i set this equal to NULL and it actually printed all of my selected pages apparently the output was set to print to the file 'filename' which was set to my document name earlier in the code, it must be set to NULL to be 'sent to the device identified by the device context handle that was passed to the StartDoc function' (msdn).
now all i gotta do is figure out why my pages are 1/10th of the size they are when i print from the view with the print button heheh
thank you so much!
-dz
|
|
|
|
|
Since you are rolling your own printing, after you attach the printer DC to you CDC object you should do this:
dc.m_bPrinting = TRUE;
In case any of your drawing code is using pDC->IsPrinting(). I didn't see it in your example code.
Have fun.
Jonathan Craig
www.mcw-tech.com
|
|
|
|
|
Hello!
I'm trying to use a vector, but it seems like I'm not that clever.
How can I sort my vector<class> by one of the Class attributes, in my case ctDate?
typedef struct tagSCHEDULEBLOCK
{ CTime ctDate;
CString csText;
}SCHEDULEBLOCK;
vector<scheduleblock*> MyVector;
Thanks for all your help!
/DrZOO
|
|
|
|
|
you will have to write a comparison function that looks something like this:
bool date_sort(const SCHEDULEBLOCK &a, const SCHEDULEBLOCK &b)
{
return (a.ctDate < b.ctDate);
}
then you can sort it like this:
std::sort(vec.begin(), vec.end(), date_sort);
-c
Cheap oil. It's worth it!
|
|
|
|
|
It looks nice, but for some reason i get an error;
d:\Program Files\Microsoft Visual Studio .NET\Vc7\include\algorithm(1856):
error C2064: term does not evaluate to a function
which point to row 2 and 3 in the code below (from algorithm)
while (_First < _Pfirst
&& !_Pred(*(_Pfirst - 1), *_Pfirst)
&& !_Pred(*_Pfirst, *(_Pfirst - 1)))
--_Pfirst;
Can you please help me?
Should I pass some parameters to date_sort?
Thanks once again lifesaver
/DrZOO
|
|
|
|
|
it compiles fine for me.
#include "stdafx.h"
#include <vector>
#include <algorithm>
typedef struct tagSCHEDULEBLOCK
{ CTime ctDate;
CString csText;
}SCHEDULEBLOCK;
bool date_sort(const SCHEDULEBLOCK &a, const SCHEDULEBLOCK &b){ return (a.ctDate < b.ctDate);}
void Test()
{
std::vector<SCHEDULEBLOCK> vec;
std::sort(vec.begin(), vec.end(), date_sort);
}
-c
Cheap oil. It's worth it!
|
|
|
|
|
I think my problems are because my vector holds pointers (vector < SCHEDULEBLOCK* >).
I read Paul Wolfensberger's article "Using the std::sort() Method" before but I don't quite get it.
This code works...;
struct MySort
{
bool operator()(const SCHEDULEBLOCK* a, const SCHEDULEBLOCK* b)
{
return (a->ctBlockDate < b->ctBlockDate);
}
};
... but it doesn't look that nice.
/DrZOO
|
|
|
|
|
this defines the comparison operation as a function of the object. the way i showed defined the comparison as a global function. either way is fine.
DrZOO wrote:
it doesn't look that nice
it's STL - it shouldn't look nice!
-c
Cheap oil. It's worth it!
|
|
|
|
|
yup!
The earth is not dying. It is being killed.
|
|
|
|
|
Can anyone tell me, how can I implement Show desktop button without IShellDispatch4 object? Well I can get desktop window handle, I can go through list of child windows and minimize them, but not all of theese are aplicable.
Thank You
Jirka
|
|
|
|
|
I haven't tried this, but I've got the hunch it should work: in your windows directory there's a shortcut file named Show Desktop.sfc . If you invoke it programmatically with ShellExecute the desktop should be bringed to the foreground. This has two problems:- In non-English versions of Windows, this shortcut file has a different name.
- This file is not present in Windows 95 (I think)
To workaround these two issues, simply copy and paste the shortcut to your app directory, rename it to whatever you please and execute this instead.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
It is what I don't want. This script call IShellDispatch4 method. Problem is, that copy .scf file is not enough. You need IShelDispatch4 interface, that You don't find on W95 and also on WindowsNT.
Jirka
|
|
|
|
|
Hi,
I have a BHO which can open urls in the current instance of IE or a new instance of IE. However, if I open a url in a new instance and then close the new window, and then try to browse to any other url from the original BHO, nothing happens! Below is my code:
VARIANT vFlags = {0};
vFlags.vt = VT_I4;
vFlags.lVal = navOpenInNewWindow;
CComVariant vtEmpty;
if(bInNewWindow)
m_spBrowser->Navigate(_bstr_t(sUrl), &vFlags, &vtEmpty, &vtEmpty, &vtEmpty);
else
m_spBrowser->Navigate(_bstr_t(sUrl), &vtEmpty, &vtEmpty, &vtEmpty, &vtEmpty);
VariantClear(&vFlags);
Any ideas why this is happening, and a solution?
Thanks!
Chris
|
|
|
|