Click here to Skip to main content
16,006,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalretrieve the harddisk serial number Pin
vgkotha10-Oct-02 1:05
vgkotha10-Oct-02 1:05 
GeneralRe: retrieve the harddisk serial number Pin
KarstenK10-Oct-02 1:14
mveKarstenK10-Oct-02 1:14 
GeneralRe: retrieve the harddisk serial number Pin
Kannan Kalyanaraman10-Oct-02 1:19
Kannan Kalyanaraman10-Oct-02 1:19 
GeneralRe: retrieve the harddisk serial number Pin
Daniel Turini10-Oct-02 1:38
Daniel Turini10-Oct-02 1:38 
GeneralPeculiar warning!!! Pin
Nish Nishant10-Oct-02 0:12
sitebuilderNish Nishant10-Oct-02 0:12 
GeneralRe: Peculiar warning!!! Pin
Andreas Saurwein10-Oct-02 0:21
Andreas Saurwein10-Oct-02 0:21 
GeneralRe: Peculiar warning!!! Pin
Daniel Turini10-Oct-02 1:32
Daniel Turini10-Oct-02 1:32 
GeneralExport data to excel Pin
Gérald Mercet10-Oct-02 0:06
Gérald Mercet10-Oct-02 0:06 
Hi everybody,

I would like to export data from a safearray to range in excel. So, ii've read the articles Q186120 which gives an explantion and an example to do it. I've tried to test it in my application, first i ve done simply in trying to put in a specific set of range the figure "1". But when i test it it doesn't work the only first cell ("A1") is filled by "1", WHY??? So, you could find the code i've wrote, so, if someone could help me!

Thanks in advance
.
.
.
.
_Application FracApp;
_Workbook FracBook;
_Worksheet FracSheet;
Workbooks FracBooks;
Worksheets FracSheets;
Range FracRange;
LPDISPATCH lpDisp;
COleVariant Optional((long)DISP_E_PARAMNOTFOUND,VT_ERROR);
COleSafeArray FracArray;
DWORD NumOfElements[2];
int NumberOfRows,NumberOfCols; //pour le "SAFEARRAY"
long FracIndex[2];
long lRow,lCol;
double Temporary;

if(!FracApp.CreateDispatch("Excel.Application"))
{
AfxMessageBox("Pb avec CreateDispatch sur Excel");
return;
}
lpDisp=FracApp.GetWorkbooks();
ASSERT(lpDisp);
FracBooks.AttachDispatch(lpDisp);
lpDisp=FracBooks.Open("D:\\FractaLab\\Fractal_v1_0\\Test.xls",Optional,Optional,Optional,Optional,Optional,Optional,Optional,Optional,Optional,Optional,Optional,Optional);
ASSERT(lpDisp);
FracBook.AttachDispatch(lpDisp);
lpDisp=FracBook.GetWorksheets();
ASSERT(lpDisp);
FracSheets.AttachDispatch(lpDisp);
lpDisp=FracSheets.GetItem(COleVariant((short)1));
ASSERT(lpDisp);
FracSheet.AttachDispatch(lpDisp);
lpDisp=FracSheet.GetRange(COleVariant("A1"),COleVariant("A1"));
ASSERT(lpDisp);
FracRange.AttachDispatch(lpDisp);

NumberOfRows=m_dlgNumHisto+1-m_dlgNumSample;
NumberOfCols=256;
FracRange.GetResize(COleVariant((short)(NumberOfRows)),COleVariant((short)(NumberOfCols)));
FracApp.SetVisible(TRUE);
FracRange.Clear();

//Création du tab de type SAFEARRAY.
NumOfElements[0]=NumberOfRows; NumOfElements[1]=NumberOfCols;
FracArray.Create(VT_R8,2,NumOfElements);

//Remplissage du SAFEARRAY
for(lCol=0;lCol
GeneralRe: Export data to excel Pin
KarstenK10-Oct-02 1:13
mveKarstenK10-Oct-02 1:13 
Questionhow to get handle of copying files within Explorer? Pin
vic_dongyx9-Oct-02 22:53
vic_dongyx9-Oct-02 22:53 
AnswerRe: how to get handle of copying files within Explorer? Pin
Kannan Kalyanaraman9-Oct-02 23:38
Kannan Kalyanaraman9-Oct-02 23:38 
GeneralRe: how to get handle of copying files within Explorer? Pin
vic_dongyx9-Oct-02 23:52
vic_dongyx9-Oct-02 23:52 
GeneralRe: how to get handle of copying files within Explorer? Pin
Kannan Kalyanaraman10-Oct-02 0:04
Kannan Kalyanaraman10-Oct-02 0:04 
GeneralISAPI Filter Pin
Tili9-Oct-02 22:37
Tili9-Oct-02 22:37 
GeneralTo kill a win32 app via batch file Pin
rsasalm_9-Oct-02 22:37
rsasalm_9-Oct-02 22:37 
GeneralRe: To kill a win32 app via batch file Pin
l a u r e n10-Oct-02 3:17
l a u r e n10-Oct-02 3:17 
GeneralRe: To kill a win32 app via batch file Pin
rsasalm_10-Oct-02 4:21
rsasalm_10-Oct-02 4:21 
GeneralRe: To kill a win32 app via batch file Pin
l a u r e n10-Oct-02 4:39
l a u r e n10-Oct-02 4:39 
QuestionHow to print/Preview the static Pin
kanat9-Oct-02 21:58
kanat9-Oct-02 21:58 
AnswerRe: How to print/Preview the static Pin
Anonymous10-Oct-02 0:46
Anonymous10-Oct-02 0:46 
GeneralNOMIRRORBITMAP Pin
Gleb9-Oct-02 21:30
Gleb9-Oct-02 21:30 
Generalvery silly problem Pin
Chanda.com9-Oct-02 21:22
Chanda.com9-Oct-02 21:22 
GeneralRe: very silly problem Pin
Nish Nishant9-Oct-02 22:03
sitebuilderNish Nishant9-Oct-02 22:03 
GeneralRe: very silly problem Pin
Jon Hulatt9-Oct-02 22:03
Jon Hulatt9-Oct-02 22:03 
GeneralSaving Application settings for next restarts Pin
Soni9-Oct-02 21:17
Soni9-Oct-02 21:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.