|
Didnt you recognize that you have now a 64bit machine on your table? So the pointers are now 64bit instead of 32bit.
...if you're under 8 or younger. Chris Maunder, the Lounge
|
|
|
|
|
|
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
|
|
|
|
|
I think your only settings the first value. Maybe the approch with the array is not the easiest way. If done this (where is the code???) with writing to a cell and the changing the position, it worked well.
Tip: if you write in a csv (comma separated file) with ";" as delimiter excel can open it easily. If you need you can also deploy a excel macro to some strange things.
If also read in CP an article about writing to Excel via ODBC Functions, it is working.
|
|
|
|
|
HI:
When I droped files from one folder to another folder, or I selected "Paste" menuitem of ContextMenu in a folder, I want to get handle before actual Copying operation, is that possible within Explorer?
Regards
Vic
|
|
|
|
|
Probably ICopyHook Interface might help you.
Cheers,
Kannan
|
|
|
|
|
but the interface ICopyHook can only handle folder and printer object, not involve file object.
best regards
|
|
|
|
|
Ooops...sorry I didn't notice that.
How about using API's like SHChangeNotify or probably write a namespace extension (I know this may be too much .. but can't think of any API as such which you can use)
I guess the best option could be try to get your hands on FileMon from sysinternals (they have the source for that ) the solution in implemented as a vxd.
http://www.sysinternals.com/filemon.htm[^]
Cheers
Kannan
|
|
|
|
|
How can i change contents of RAW HTML being sent. I get memory leaks all the time. how to manage it.
I want to prefix or append some exta HTML. How can i do tht.
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
|
Hi all,
I have a GUI win32 application.
When one instance is running I cann't run another instance because the application is communicationg with external hardware.
Before to run another instance of this application I have to close the running application manually.
Now I want to run this application a number of times with different arguments using a batch file.
Now I wonder how I can give command in my batch so that it can close the running application before next instance of appliction starts.
Batch file may look like:
1. Test.exe arguments
kill Test.exe (1)
2. Test.exe arguments
kill Test.exe (2)
and
so on
Hope I have explain my problem.
Any help in this regard
will be appreciated
regards
/rsasalm
|
|
|
|
|
write a lil app (kill.exe) that accepts command line args of the name of the app to kill
in the kill.exe get the process id of the app to kill
send a wm_close message to it
make sure the app to kill will process those messages
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" biz stuff about me
|
|
|
|
|
Hi Lauren,
Thanks for reply.
I would appreciate if you or someelse can give me a code example of killing another application B from one application A.
As least how to get the process id of an applicatin and then kill that.
Further, I guess the kill.exe you mentioned should be a Win32 application so that it can take wm_close message.
thanks again for your help
regards
/rsasalm
|
|
|
|
|
|
hi could not you suggest how to manage the following:
I have written a program which gets data from database (Access, SQL Server)
the data are shown in static.
I need these all to be send to print/print preview or to MS Word.
one more thing: how to make some statics bigger in size and some small?
thank you
if you can help send please to bek79@mail.ru
|
|
|
|
|
Take a look in the printing section here. There is an example of how to print a long CString across multiple pages in a view. You just need to get he text from the static into the string used, and the rest should work automaticlly. This assumes that the test in your static control is multi-line.
|
|
|
|
|
Hi , i'm trying to send an image from a Hebrew OS to other computer , and i always get a mirrored image.
I tried to use NOMIRRORBITMAP in the BitBlt method , but it doesn't seems to work.
Thanks.
|
|
|
|
|
i want to open a ODBC connection in my dialog based application can anybody tell me what is a simplest way to open database connection through dialogbased application
bye
chanda.com
|
|
|
|
|
|
Check out the articles at http://www.codeproject.com/database/
In particular, you will find http://www.codeproject.com/database/simpleado.asp useful.
Signature space for rent. Apply by email to....
|
|
|
|
|
Hi!
Is there any well-known way of storing application (GUI) states, so that next time when it starts, it gets all the states and show accordingly?
Please let me know of the ways of doing it.
Thank you
Shri Ram Soni
|
|
|
|
|
It really depends on what framework or tools that you are using to develop your application.
If you are using MFC, then you are in luck, you can simply set the registry key that your app will store all of its settings in, then call WriteProfileString and GetProfileString from your CWinApp object to manage your settings.
If you are using any other tools there are most likely methods to help ease the trouble of saving your settings. Depending if you want to save them in an ini file you can use WritePrivateProfileString. Of If you want to save your settings in the registry you will need to open a registry key and create new settings.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Does the following function work, if UNICODE is defined and when UNICODE is not defined?
I think that the line if (c != ' ') could be a problem!
Does this line works correct in both systems (UNICODE and non UNICODE)?
(This function should remove all spaces in a string!)
const CString CSerialize::WithoutSpaces(const CString str)
{
CString strTemp;
ASSERT(strTemp.IsEmpty());
for (int n = 0; n < str.GetLength(); n++)
{
TCHAR c = str.GetAt(n);
if (c != ' ')
{
strTemp += CString(c);
}
}
return strTemp;
}
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
the ' ' will translate to a char that contains a space or 0x20, which is 32 in decimal. In order for this to work properly in Unicode, you will need to cast your ' ' to a TCHAR, which will give you this 0x0020. Here is an example:
<br />
if (c != (TCHAR)' ')<br />
{<br />
...<br />
This will basically expand the single BYTE char to a double BYTE wchar_t which is what the TCHAR is declared as when the UNICODE macro is set.
Good Luck
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
My first guess would be to change (c != ' ') to (c != _T(' ')) so the space is treated as a wchar_t in Unicode builds.
--Mike--
Just released - 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
You probably have a paradox where the DLL depends on the executables lib file to link properly, however the executables lib file has not yet been created because it depends on teh DLL being compiled first. If this is the problem, then I would remove the DLLs reference to the EXE until it compiles, with the exported lib file, then add the references back in and recompile the DLL.
Another thing that you could do is change your code in the DLL to call GetProcAddress for your executable and create a function pointer to the MyFunc procedure. They you would not have to worry about the linking at all.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|