|
I'd simply open the two documents in concern, copy the information as required. Depends on just how you want to combine the two files.. For instance - do you wish to combine the information in Sheet1 of each workbook into a single Sheet1 of a third workbook? Do you wish to add an entire worksheet from each input workbook such that the output contains as many sheets as there are input files?
My first step would be to start excel and begin recording a macro. I would then do manually what I'd like to do with automation before I stopped the macro recording and looked at the code that my copy/paste actions had created.
I'm assuming that you want to control excel using msvc? Got no idea about the necessary COM work involved, there's plenty of examples around here. You could also use your c++ code to start an instance of excel with a macro enabled workbook that would perform all of your desired work. (if you'd prefer to use some quick'n'dirty VBA)
|
|
|
|
|
You might have better luck in the Visual Basic forum, as this sounds like a job for VBA.
|
|
|
|
|
Le@rner wrote: can anybody help me to... Ok, so what do you have so far?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I am sure some of you gurus will jump up when you see this question.
Not to worry - I am just looking for a easy way to clear <b>MY registry entries </b>during debugging.
I am using WriteProfileString and associated API functions and since I am adding multiple entries into registry during development I would like to be able to clear them programmatically ( I hate this word – sounds so stuffy ) .
I am not particularly willing to use another API set, so how can I accomplish this ?
Thanks for reading
Vaclav
|
|
|
|
|
Vaclav_Sal wrote: I am using WriteProfileString and associated API functions and...I would like to be able to clear them programmatically...
So why can't you use WriteProfileString() to do this?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
By explicitly setting some of the parameters to WriteProfileString () to NULL , you accomplish the "delete" function. See the documentation[^]
|
|
|
|
|
Thank you.
I need to quit relying on my 2001 MSDN and check the web site more often.
|
|
|
|
|
I am writing a dialog box using VS resource editor. In the dialog, I put a search control that is expected to be the same as IE8's search box: a line edit control and a BS_OWNERDRAW style push-button control sitting side by side. I use the bitmap file Search.bmp in VS2008ImageLibrary directory. My problem is the bitmap is not drawn transparently. It's pink background is drawn on the button. This takes on an ugly apperance. How can I remove the pink background? Here is code I use to draw the bitmap:
case WM_INITDIALOG:
// Load image for search button
hBitmap = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_SEARCH));
case WM_DRAWITEM:
LPDRAWITEMSTRUCT lpDIS = (LPDRAWITEMSTRUCT)lParam;
HDC hDC = lpDIS->hDC;
RECT rectItem = lpDIS->rcItem;
// Draw the bitmap on button
if ( hBitmap != NULL ) {
RECT rcImage;
BITMAP bm;
LONG cxBitmap, cyBitmap;
if ( GetObject(hBitmap, sizeof(bm), &bm) ) {
cxBitmap = bm.bmWidth;
cyBitmap = bm.bmHeight;
}
// Center image horizontally
CopyRect(&rcImage, &rectItem);
LONG image_width = rcImage.right - rcImage.left;
LONG image_height = rcImage.bottom - rcImage.top;
rcImage.left = (image_width - cxBitmap)/2;
rcImage.top = (image_height - cyBitmap)/2;
DrawState(hDC, NULL, NULL, (LPARAM)hBitmap, 0,
rcImage.left, rcImage.top,
rcImage.right - rcImage.left,
rcImage.bottom - rcImage.top,
(bIsDisabled ? DSS_DISABLED : DSS_NORMAL) | DST_BITMAP);
}
|
|
|
|
|
Does the bitmap have an alpha channel (or it uses a colorkey for transparency)? Whichever it is, does DrawState support it (can't see that in its documentation).
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
Hi, I am not sure if the bitmap has alpha channel or not. It is indeed the file C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\VS2008ImageLibrary\1033\VS2008ImageLibrary\Objects\24bit_bitmaps\search.bmp. Would you please take a look at this file if you have VS 2008?
|
|
|
|
|
Hi,
Typically when you see those pink RGB(255,0,255) chroma key backgrounds... the pink is designated as the 'transparent' color. Supposedly a statistical analysis of random images determined that pink is the least used color. I can't remember where I read this, I think I heard it from Feng Yuan.
Anyway, you are probably looking for the TransparentBlt function[^] and pass RGB(255,0,255) as the crTransparent argument.
Since you are using a BS_OWNERDRAW style push-button... and the DrawState function [^] you would probably need to set the DST_COMPLEX flag and implement a DrawStateProc callback function[^] and inside that function call TransparentBlt[^]
Best Wishes,
-David Delaune
|
|
|
|
|
Thank you very much, I'll try your method today.
|
|
|
|
|
I replace DrawState with TransparentBlt and it works. Thanks again.
|
|
|
|
|
Transparencies are not supported.
You'll have to fake it.
|
|
|
|
|
It needs to display remote disk info in Application. So I should get the driver icon, but I do not know how to get the driver icon.
I use the API SHGetFileInfo to get file icon and folder icon, But I do not know how to get the Driver icon.
I try to get driver "c:\" icon index and set to CTreeCtrl, but if there is no C disk in computer, error happens.
|
|
|
|
|
yu-jian wrote: if there is no C disk
The system partition can be derived from several of the environment variables, ProgramFiles being one of them.
|
|
|
|
|
You can use deleaker or similary tool for search memory leaks.....
|
|
|
|
|
Sorry, what?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I use cork plug to stop a leak.
Is that OK?
|
|
|
|
|
I'm building a simple editor in a CFrameWnd using a CRichEditCtrl for the text.
As a stand-alone application everything works.
When I put the same frame code into a regular DLL, most things still work, but all custom accelerators don't function (things like Ctrl-V, Ctrl-C, etc. which are handled by the CRichEditCtrl do).
I've been able to recreate this same problem with the CMainFrame code generated by the Visual Studio Wizard.
Does anyone have any suggestions?
NciTom
|
|
|
|
|
Hi,
May be the following link will help you.
http://social.msdn.microsoft.com/Forums/en-US/vcmfcatl/thread/8bbdbd37-8034-4489-bd86-2351f0febb37
Cheers
|
|
|
|
|
Thanks Satheesh,
Unfortunately the link you suggest is one that I started in MSDN. Since it didn't get resolved there, I tried this forum.
|
|
|
|
|
Try to change the regular dll to MFC extension dll.
|
|
|
|
|
Patup,
Thanks,
Easier said than done.
I took the trivial mainfrm code from a wizard generated single document app and massaged it into an extension DLL. I can get it to compile, but it traps during the load of the MainFrm window.
Does anyone know of an example of an extension DLL that loads a CFrameWnd?
|
|
|
|
|
ncitom wrote: I took the trivial mainfrm code from a wizard generated single document app and massaged it into an extension DLL.
Based on your brief description... it sounds like something related to either activation context[^] or the MFC module state[^].
I would be willing to have a look at your test case if you could put it up somewhere where I could download. However I offer no guarantees.
Best Wishes,
-David Delaune
|
|
|
|