see i have created the com dll for shell context menu ..
if (DragQueryFile((HDROP)medium.lpszFileName, i, path, MAX_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 .....
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 ..
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
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.
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.
I have tried this code with a variety of names (supposedly in Excel) but get the same response each time. The MSDN documentation is not very helpful so I'm not sure where to go from here. However, once again I would ask, what problem are you actually trying to solve?