|
It compiles fine because it's OK in theory. In practice, you're obviously looking up indexes into the array which do not exist.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
thanks, i got it now . I thought passing array is reference so i just assign the location to the parameter. But later on i made a for loop to copy it to the actual parameter so it works just fine but when i output it out it only gives me the memory address.
Cheers
|
|
|
|
|
Dear sir :
I am developing a driver of keyboard , I hope to write a service program
to control logon interface of winXP .do "up arrow "and"down arrow " action by hotkey. can you tell me how control logon interface ? for example ,get logon handle , get the user's ID of logon interface .
thanks!
|
|
|
|
|
Look at Winlogon and GINA in MSDN,
you need to learn a lot before you can actually
control the Logon Process, Wish u the best in the effort.
|
|
|
|
|
Ok here is what I want to do:
1) load data into excel from C++ App
2) format cells and merge cells from C++ App
3) Print using excel directly from my C++ App
I have found some articles that deal with C++ and Excel, but nothing that really deals with printing. Is it possible? If it isn't is there a way to call a macro and have the macro print the sheet?
Now the kicker. My app will be distributed to many users that have different versions of excel. What is the best way to handle this? Is it as simple as making sure to not use functions that aren't present in earlier versions, or is it much more complicated than that.
Any suggestions or advice?
Thanks in advance.
***********************
Tony Fontenot
Recreational Solutions
tony@recsolutions.com
***********************
|
|
|
|
|
Tony,
You Have luck.
I just sent to code project an article that explain all you want to know.
I dont know when it will be shown .
check your email - i sent the article directly to you.
By.
Aizik Yair
Software Engineer
|
|
|
|
|
Is this really possible to call printing of Excel Application?
|
|
|
|
|
Yes it is.
and not just print but all the things you know with excel..
I suppose my article will be publish soon.
Aizik Yair
Software Engineer
|
|
|
|
|
AFAIK you can control Excel with automation. In the MSDN the automation of excel is written in VB but it also works in a similar way in VC. If you want to do it in VC you have to "#import" an dll with this interface. It creates the com-Interface with the names of the methods. And than code trough the dschungle.
|
|
|
|
|
|
You need to find someone with older MSDN CD sets.
Christian
The tragedy of cyberspace - that so much can travel so far, and yet mean so little.
And you don't spend much time with the opposite sex working day and night, unless the pizza delivery person happens to be young, cute, single and female. I can assure you, I've consumed more than a programmer's allotment of pizza, and these conditions have never aligned. - Christopher Duncan - 18/04/2002
|
|
|
|
|
In fact, all of the sdk samples have been removed from msdn. Does somebody know where they are?
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Let me know which ones you want, I can Email them to you.
---
CPUA 0x5041
Sonork 100.11743 Chicken Little
Orgasms are universal!! -- Mike Mullikin in The Lounge 21:27 15 May '02
|
|
|
|
|
That would be nice
You need to have an older msdn library.
samples:
- AVIEdit
- AVIView
- MPlay
- WriteAVI
I don't know if they are .cpp or as complete projects. If you zip them, they should be small.
TNX in advance
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
I clicked the link and got the page. Maybe it was down.
Must try, try, really try... you can get it if you really want
(a really good reaggy song from Jimmy Cliff)
|
|
|
|
|
That link works, that's right.
But if you look closer, you see that there's a message: "THESE SAMPLES ARE NO LONGER AVAILABLE"
[VISUAL STUDIO 6.0] [MFC] [WIN98/2]
Bluute tette!
|
|
|
|
|
Hi,
I recently started my application under Windows XP. Everything is fine, but when I use mousewheel in my CListBox derievd class the scrolling is totaly strange. Scrolling up/down with scrollbar or keys is still normal.
Anyone knows what causes that... and more important, how to prevent?
Thx, Moak
|
|
|
|
|
You mean it appears to scroll backwards? It does this in Win2K also; it's apparently controlled the menu animation setting (desktop properties->effects->menu animation). You'll need to completely disable menu animation in order to fix it though; changing it to fade doesn't work.
---Shog9---
From now on we can call C# and MC++ "The square wheel languages" -- Jack Handy, The Lounge
|
|
|
|
|
yes, kind of backwards scrolling. So there is nothing I can do against it when using a listbox derived class? Is it a endusers choice?
|
|
|
|
|
'fraid so. At least you can blame it on MS ;~)
---Shog9---
From now on we can call C# and MC++ "The square wheel languages" -- Jack Handy, The Lounge
|
|
|
|
|
hehe. Oh you don't know how many 'winows API sux' comments I allready have in my sourcecode. )
But seriously, I came to a point where I think about reimplementing a listbox control for a chat (including emoticons and hyperlinks). I used a CListBox derived class and finally it works somehow, but it doesnt feed 100% to all my needs. I spyed on mIRC chat GUI, he used a static control in the chat output. That's a pure ownerdraw listbox-kind-of control, I assume.
Greets, Moak
|
|
|
|
|
Hio!
I am trying to allow my user to select any number of documents to print (classes derived from CFormView).. basicly they select a bunch of documents and in the CMainFrame i loop through their choices, call OnOpenDocument(), set the bottom view to the cformview, and call its BatchPrint() member function, which in turn calls CFormView::OnFilePrint()
the problem with this is that it pops up the printer selection dialog everytime..
so i have tried to create a CPrintInfo object and pass it to my BatchPrint() function, which has all of the actual code from CFormView::OnFilePrint()..
My OnPreparePrinting() only calls DoPreparePrinting() if the CPrintInfo hasn't been set once.. if its already been set then it uses the existing CPrintInfo.. my problem is that my CPrintInfo keeps getting the destructor called somehow before im done with it..
in any event.. is there a simpler way to switch a view, print a view (give print dialog), switch view, print view (no print dialog), switch view, print view (no print dialog), etc.. so the user only chooses the printer once..
any suggestions?
-dz
|
|
|
|
|
This code should get you going:
void CMyView::OnBatchPrint()
{
DOCINFO di ;
CPrintInfo printInfo ;
CMyDoc *pDoc = GetDocument() ;
CString filename ;
CDC dc ;
CRect draw_area ;
ASSERT_VALID(pDoc) ;
filename = pDoc->GetPathName() ;
filename.MakeLower() ;
CPrintDialog dlg(TRUE) ;
HDC hDC = dlg.CreatePrinterDC() ;
if (hDC == NULL)
return ;
di.cbSize = sizeof(DOCINFO) ;
di.lpszDocName = pDoc->GetPathName() ;
di.lpszOutput = filename ;
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) ;
for (printInfo.m_nCurPage = 1 ; printInfo.m_nCurPage <= printInfo.GetMaxPage() ; printInfo.m_nCurPage++)
{
dc.StartPage() ;
OnPrint(&dc, &printInfo) ;
dc.EndPage() ;
printInfo.m_rectDraw = draw_area ;
}
OnEndPrinting(&dc, &printInfo) ;
dc.EndDoc() ;
VERIFY(dc.DeleteDC()) ;
}
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
seemed like this code was going to work great by itself, but the call hDC = dlg.CreatePrinterDC(); always returns null..
i see that you declare a CPrintInfo and CDC var at the top, but they never get setup it seems.. i thought maybe i needed to do dc = GetDC(), but that returns a pointer instead of an actual CDC..
could you help a little bit more and let me know what I need to do to keep from falling out at the CreatePrinterDC command? and also help me understand how the CDC you declare gets set to the CDC of the view? thank you!
-dz
|
|
|
|
|
The only problem seems to be the CreatePrinterDC call. I copied that code from a procedure and moded it to use a CPrintDialog object to get the DC without checking it.
The MSDN says that you could get a HDC like this:
CPrintDialog dlg(FALSE) ;
HDC hdc = dlg.CreatePrinterDC() ;
The CDC created earlier in the procedure will be used to wrap the HDC returned from CreatePrinterDC() on the line dc.Attach(hdc), so you can use a standard CDC object when printing as expected by OnPrint() etc
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|