|
Hello,
Does any one knows how to compile COM for VB6, my application contain one .Fig file as interface and .m file containing code and
one Excel file for data.
My problem is how to compile all together in dll which i can call
from VB6.
Regards,
Djamel AIT AMRANE
|
|
|
|
|
I recently upgraded my project from .net 3.5 to 4.0. My Word Interop Assembly was working on client machines just fine in .net 3.5. After upgrading to .net 4.0 I changed the Embedded Interop Types property to false. Now some clients are looking for Interop.Microsoft.Office.Core when previously they weren't. My question is how come the clients are looking for this assembly with .net 4.0 when they weren't in .net 3.5?
|
|
|
|
|
This seems to be a common issue[^] when upgrading from .Net 3.5 to .Net 4. According to the link you'll need to manually include (or re-reference) the COM libraries into your .Net 4.0 project.
|
|
|
|
|
Thanks Marco. I ended up adding the reference to Microsoft.Office.Core and that worked. It's just odd - I didn't need that reference in previous .net versions.
|
|
|
|
|
You are welcome - As I supposed, it came up with V4 of the .NET framework. Maybe earlier versions of the framework have added the reference by itself.
|
|
|
|
|
hopefully i am posting in the correct section.
I have created a class in c# to replace a vb6 class used in an asp web page. Note I said asp and not asp.NET. I am running this in IIS 7.5 on a 64 bit Windows 7 machine.
I compiled the program and all its support dlls as x86 and believe I got all the correct tags and check boxes for COM. I can create and use the class in VB6 but it still bombs in vbscript with can't create object. I found some articles on going to do tweaks in the registry to get it to work on 64 bit but alas no avail.
The web application will run with the old VB6 object just fine. The configuration is an application with a separate pool set to pipeline mode classic, no managed code, enable 32 bit applications = true;
Initially I was getting a can not create object when trying to use the new c# object but I copied the dll and its support dlls to the sysWOW64 directory and it changed it's tune to
MaxRecall.Shared error '80004003'
Object reference not set to an instance of an object.
/mr/mrq.asp, line 193
the structure of the project is thus
the object I am creating with createobject is dependent on a single assembly, MaxRecall.CORE, which is dependent on two assemblies, MaxRecall.CLIENTS and MaxRecall.Shared. None of the support assemblies are com exposed so this error is not a COM error at all I think.
MaxRecall.Shared is totally static with zero objects to create. It only had two static doubles that were class scoped that were not instantiated but I set them to 0 in their declarations. To my thinking there are no objects in MaxRecall.Shared to gain an instance to so the error is odd.
Sigh. Any and all insights are desperately welcomed. I cross posted this in the ASP.net section.
|
|
|
|
|
I hope I'm asking in the right place.
I don't have Win8 machine available and my computer can't run Win8 in a virtual machine, so I'm asking for help from someone with Win8 machine to find out why my code doesn't work in Win8.
I received request for a small project, namely Explorer thumbnail shell extension for OpenRaster (*.ora) files saved by the MyPaint application.
OpenRaster files have the same structure as OpenOffice files (*.odt, etc...), the thumbnail is stored as "Thumbnails\thumbnail.png" inside the zip file.
I've made similar thumbnail shell extensions before and I have working code from previous projects but it's a bit more complicated.
This time I got inspired by article I found here (Google translate FTW!):
http://eternalwindows.jp/installer/zip/zip02.html
Apparently you can use CompressedFolder zip storage handler COM object (from zipfldr.dll) as described in the article, pretty elegant and lightweight even though it doesn't support Unicode file names inside zip.
My code finds and extracts thumbnail.png inside the zip and loads it with ATL::CImage.
I've made this activex dll (ATL project, source + 32/64bit binaries):
https://dl.dropbox.com/u/61407853/orathumbs1002.zip
I use VC2008 Express + Win7 SDK + ATL7 headers (from WDK) and I started off with VC6 ATL project skeleton.
Everything compiles without warnings and everything worked fine both on XP and Win7 32/64-bit but I'm told it doesn't work on Win8 x64, the dll is registered and thumbnail cache cleared but no thumbnails are generated, and I couldn't say where's the problem without access to Win8 machine.
Here is a small Win32/ATL dialog project that tests the extracting code:
https://dl.dropbox.com/u/61407853/ThumbTest.zip
Inside the zip is the source, compiled exe (debug release) and 2 test files (1 good and 1 with invalid thumbnail). The dialog accepts dropped files and shows the thumbnail if successful.
It pops up a messagebox with a description of HRESULT error and calling location in source file (just hit Ctrl+C to copy text from messagebox).
I don't know what is the problem, is my activex dll code broken or is the extracting code broken, do I need to compile with VS2012/WinSDK8 or something else, so if someone could help me track down the problem (compile and debug), it would be greatly appreciated.
My apologies if my post is chaotic, I try to describe in as much detail I can.
|
|
|
|
|
I would think you'd be extremely lucky if you found someone here with time and the setup to do what you suggest - not impossible, but a good deal of the inhabitants here do have day jobs
T800G wrote: but I'm told it doesn't work on Win8 x64, the dll is registered and thumbnail
cache cleared but no thumbnails are generated, and I couldn't say where's the
problem without access to Win8 machine.
T800G wrote: It pops up a messagebox with a description of HRESULT error and calling location
in source file (just hit Ctrl+C to copy text from messagebox).
When I read these, I thought surely its no different from a standard deploy to (remote) customer setup - the bit you have missed, it seems to me, is trace/debug logging - can you log trace/debug statements/results (etc) to a file, and get that sent back to you ?
Ideally you'd also have a snapshot of the things like the event logs etc or a crashdump from the machine so you could analyse it
'g'
|
|
|
|
|
In short - I'm interested which interfaces are supported on CompressedFolder COM object.
http://i47.tinypic.com/14m49xx.png
You can use OLE/COM Object Viewer and post screenshot/write down interfaces.
|
|
|
|
|
hello all,
i have to know how can i use the path of file or folder which has been selected from context menu in an exe or application code ...
see i have written the code for context menu and am storing the file or folder path in an cstring
how can i use this cstring variable in exe code ..
Best Regards
Sarfaraz.. 
modified 28-Feb-13 1:59am.
|
|
|
|
|
sarfaraznawaz wrote: how can i use this cstring variable in exe code The same way that you would use any value. Please explain what you are trying to do with the contents.
Use the best guess
|
|
|
|
|
see i have created the com dll for shell context menu ..
if (DragQueryFile((HDROP)medium.lpszFileName, i, path, MAX_PATH))
{
g_szSelectedFiles.SetAt(i, path);
szFileName = g_szSelectedFiles[i];
}
from here i am getting the path (szFileName )i want in exe code so that i can proceed this my doubt ..
the variable is decalred as static in header file of the dll .i link the library of dll .the scope is not remaining .....
Best Regards
Sarfaraz
|
|
|
|
|
What do you mean by "i want in exe code"; I am afraid that makes little sense.
Use the best guess
|
|
|
|
|
the path(Szfilename)is useed in dll .Now this szfilename path i want use in the application code .
i explain how i tried i linked the dll lib to an application code and then i included the header file of the dll in an application code so that i can use the path(szfilename).
this szfilename is declared in static so its scope remain in application code also ..
|
|
|
|
|
Then you either need to export it from the dll or provide a function that will return it to the calling application.
Use the best guess
|
|
|
|
|
Hi,
I have the following code sequences whose pourpose is to display a .txt file in a Excel Spreadsheet, however the .txt file is not being loaded after I execute workbooks.opentext
a workbook is loaded but there are no sheets displayed let alone text
I get good return codes from IDispatch->invoke and good return codes in excpInfo
I have changed the file name to a bogous name and the same thing happens
app.CreateDispatch("Excel.Application"); Workbooks objBooks(app.Workbooks());
Workbooks objBooks = app.GetWorkbooks();
COleVariant FilenameOpen(File),
FilenameSave(XlsFile),
Origin((short)2), StartRow((short)1),
DataType((short)1), TextQualifier((short)1), ConsecutiveDelimiter((long)FALSE, VT_BOOL),
Tab((long)FALSE, VT_BOOL),
Semicolon((long)TRUE, VT_BOOL),
Comma((long)FALSE, VT_BOOL),
Space((long)FALSE, VT_BOOL),
Other((long)FALSE, VT_BOOL),
Otherchar((long)FALSE,VT_BOOL),
Fieldinfo((long) FALSE, VT_BOOL),
TextVisualLayout((long)FALSE, VT_BOOL),
DecimalSeperator((long) FALSE, VT_BOOL),
ThousandSepartor((long) FALSE, VT_BOOL),
TrailingMinusNumbers((long) FALSE, VT_BOOL),
Local((long) FALSE, VT_BOOL),
Fileformat((short)33), Save((long)FALSE, VT_BOOL);
COleSafeArray saRet;
DWORD numElements[2];
numElements[0] = 2;
numElements[1] = 2;
saRet.Create(VT_I4,2,numElements);
long index[2];
long val;
index[0]=0;
index[1]=0;
val = 1;
saRet.PutElement(index,&val);
index[0] = 1;
index[1] = 0;
val = 2;
index[0] = 1;
index[1] = 1;
val = 9;
objBooks.OpenText((LPCTSTR)"C:\\Program Files\\Microsoft VIsual Studio\\MyProjects\\I46023\\I46023.txt", Origin, COleVariant((long)1),COleVariant((long)1),
1,
ConsecutiveDelimiter, Tab, Semicolon,
Comma,Space,Other,Otherchar,saRet,TextVisualLayout,
DecimalSeperator,ThousandSepartor,TrailingMinusNumbers,
Local);
app.SetVisible(true);
app.SetUserControl(TRUE);
|
|
|
|
|
Why are you using the (LPCTSTR) cast on your file path? Do you fully understand what a cast does?
Use the best guess
|
|
|
|
|
Richard
This is the function prototype in excel.cpp
oid Workbooks::OpenText(LPCTSTR Filename, const VARIANT& Origin, const VARIANT& StartRow, const VARIANT& DataType, long TextQualifier, const VARIANT& ConsecutiveDelimiter, const VARIANT& Tab, const VARIANT& Semicolon, const VARIANT& Comma,
const VARIANT& Space, const VARIANT& Other, const VARIANT& OtherChar, const VARIANT& FieldInfo, const VARIANT& TextVisualLayout, const VARIANT& DecimalSeparator, const VARIANT& ThousandsSeparator, const VARIANT& TrailingMinusNumbers,
const VARIANT& Local)
Filename is Of type LPCTSTR
Thanks
|
|
|
|
|
ForNow wrote: Filename is Of type LPCTSTR Then you should provide a LPCTSTR in your call, rather than providing a LPCSTR , and then telling the compiler to ignore the fact that the string may not be in the correct format. Lookup the use of the TEXT() macro and make sure your strings are generated correctly, and read the documentation on the correct use of casts.
Use the best guess
|
|
|
|
|
The Text macro interperts the string if ansi is defined according to the current codepage
I think the string I am passing is being interpetted correctly
looking at the varaint type of the file it was being interpetted as a VT_BSTR
and had the correct value
case VT_BSTR:
{
LPCOLESTR lpsz = va_arg(argList, LPOLESTR);
pArg->bstrVal = ::SysAllocString(lpsz);
if (lpsz != NULL && pArg->bstrVal == NULL)
AfxThrowMemoryException();
|
|
|
|
|
ForNow wrote: I think the string I am passing is being interpetted correctly By luck, not judgement; if your project is built in UNICODE mode then it will be wrong. You should not use a cast unless you understand the consequences. Instead, use the TEXT() macro to ensure that your character string is generated in the appropriate character set to match the build. Your cast in the foregoing code is telling the compiler to ignore the fact that the string may be in the wrong character set.
Use the best guess
|
|
|
|
|
I am getting the above error from WorkBooks::OpenText
As all of the 18 paramters are optional
besides the first
I VT_NULL'ed all of them besdies the file name and still got the error
Since there is a lot of security where I work
I used the program name as the text file and still got the above errors
Any Help would be appreciated
|
|
|
|
|
You should make an effort to research error codes first: see here[^] for a number of possibilities.
|
|
|
|
|
Hi,
I am get an assert error when calling WorkBooks::OpenText
I traced it down the code to dispatch->invoke and the return code from that
was 0x80020008 DISP_E_BADVARTYPE One of the arguments in rgvarg is not a valid variant type.
I had a VARIANT for all my arguments besides the 5th which is a long
My question is then the following almost all the paramters are optional
besdides the first which is the filename
I assumed optional was a NULL so.
I coded the following for NULL
VARIANT varfalse.
varfalse.intVal = 0;
varfalse.vt = VT_INT;
is this correct ?
thanks
.
|
|
|
|
|
ForNow wrote: is this correct ?
no ... you should use
varfalse.vt = VT_EMPTY
or
varfalse.vt = VT_NULL
|
|
|
|
|