|
Hi lafleon ,
Its working excellent . I have implemented it for a 3d array and got correct result.
Thank you Very much for your help.
George
|
|
|
|
|
Hello,
Read the article on MSDN: “How to Pass Arrays between Visual Basic and C”. http://support.microsoft.com/kb/207931
Regards
|
|
|
|
|
Some more links:
1. "Passing an array from VC++ DLL to VB", by Amol Kakhandki on Code project. http://www.codeproject.com/dll/ctovbarray_passing.asp
2. http://www.manbu.net/Lib/En/Class5/Sub7/1/23.asp
|
|
|
|
|
Hi All,
I want to enumerate menu item identifiers of MS-Office apps. I found all MS-Office apps share resources stroed in some dll (MSO.dll, may be wrong). I like to disable some menu items by using subclassing or something else. So can anybody help to enumerate these id's.
Thanks a lot!
- Santosh
-- modified at 4:14 Friday 9th February, 2007
|
|
|
|
|
Hi all,
I have code for passing 2d array from VC++ to VB6(Code is given below), But My need is to pass a 3d array from VC++ to VB6, Can any one pleas replace the code I have given for 2d to 3d
STDMETHODIMP TestMacroInterface::ProcessStringArray(SAFEARRAY**ppOutputArray)
{
HRESULT hresult;
SAFEARRAYBOUND aDim[2]
aDim[0].lLbound = 0;
aDim[0].cElements = 3;
aDim[1].lLbound = 0;
aDim[1].cElements = 2
BSTR HUGEP *pbstr;
*ppOutputArray=SafeArrayCreate(VT_BSTR , 2, aDim);
if (*ppOutputArray==NULL)
{
::MessageBox(NULL, _T("NOT_OK"), _T("Pickup"), MB_OK);
}
else
hresult=SafeArrayAccessData(*ppOutputArray,(void HUGEP**)&pbstr)
pbstr[0][0] = SysAllocString(OLESTR("SOURCE_VA"));
pbstr[0][1] = SysAllocString(OLESTR("ACV"));
pbstr[0][2] = SysAllocString(OLESTR("10"));
SafeArrayUnaccessData(*ppOutputArray);
}
Thanks
George
|
|
|
|
|
georgekjolly wrote: SAFEARRAYBOUND aDim[2]
aDim[0].lLbound = 0;
aDim[0].cElements = 3;
aDim[1].lLbound = 0;
aDim[1].cElements = 2
BSTR HUGEP *pbstr;
*ppOutputArray=SafeArrayCreate(VT_BSTR , 2, aDim);
if (*ppOutputArray==NULL)
{
::MessageBox(NULL, _T("NOT_OK"), _T("Pickup"), MB_OK);
}
Change this to,
SAFEARRAYBOUND aDim[3]
aDim[0].lLbound = 0;
aDim[0].cElements = 3;
aDim[1].lLbound = 0;
aDim[1].cElements = 3
aDim[2].lLbound = 0;
aDim[2].cElements = 3
BSTR HUGEP *pbstr;
*ppOutputArray=SafeArrayCreate(VT_BSTR , 3, aDim);
if (*ppOutputArray==NULL)
{
|
|
|
|
|
Hi Prasad,
Thank you very much.
And some more help please ..
1-> How can I pass a 3d array from VB to VC++ ( Just code )
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim i As Test33CL
Dim iArray(1 To 3, 1 To 3, 1 To 3) As String
Private Sub Command1_Click()
Set i = New Test33CL
i.StringFun (iArray)
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Is there is a riht way , I am getting error.
2-> how to assign string value to BSTR *pbstr.
Thanks
George
|
|
|
|
|
Hi George,
I'm not VB guy. Lets wait some body to solve your query.
|
|
|
|
|
Hai Prasad,
Sorry for again disturbing u .. It is an assignment for me from a company ,If I am clearing this I will get Job there...
Please Just See my assignment of String to the 3d array is in Right way ,Programme I have given below..
STDMETHODIMP CTestMacroInterface::ProcessStringArray(SAFEARRAY *ppOutputArray)
{
SAFEARRAYBOUND aDim[3]
aDim[0].lLbound = 0;
aDim[0].cElements = 3;
aDim[1].lLbound = 0;
aDim[1].cElements = 3
aDim[2].lLbound = 0;
aDim[2].cElements = 3
HRESULT hr;
BSTR HUGEP *pbstr;
*ppOutputArray=SafeArrayCreate(VT_BSTR , 3, aDim);
if (*ppOutputArray==NULL)
{
Messagebox("Null");
}
else
hr=SafeArrayAccessData(*ppOutputArray,(void HUGEP**)&pbstr
/*******************************************************************
Now I need to store my data 3 dimensionaly data is
FirstName LastName Job
Ram Lakhan Engineer
Dipu Das Merchant
Vinu Lal Bussiness
a[0][0] = "Ram" , a[0][1] = "Lakhan" , a[0][2] = "Engineer"
a[1][0] = "Dipu" , a[1][1] = "Das" , a[1][2] = "Merchant"
a[2][0] = "Vinu" , a[2][1] = "Lal" , a[2][2] = "Bussiness"
**************************************************************/
// Here I have assigned my values, Is this the correct way of assigning values ??
pbstr[0] = SysAllocString(OLESTR("Ram")); // for a[0][0]
pbstr[1] = SysAllocString(OLESTR("Dipu")); // for a[1][0]
pbstr[2] = SysAllocString(OLESTR("Vinu")); // for a[2][0]
pbstr[3] = SysAllocString(OLESTR("Lakhan")); // for a[0][1]
pbstr[4] = SysAllocString(OLESTR("Das")); // for a[1][1]
pbstr[5] = SysAllocString(OLESTR("Lal")); // for a[2][1]
pbstr[6] = SysAllocString(OLESTR("Engineer")); // for a[0][2]
pbstr[7] = SysAllocString(OLESTR("Merchant")); // for a[1][2]
pbstr[8] = SysAllocString(OLESTR("Bussiness")); // for a[2][2]
SafeArrayUnaccessData(*ppOutputArray);
}
Thanks
George
|
|
|
|
|
georgekjolly wrote: a[0][0] = "Ram" , a[0][1] = "Lakhan" , a[0][2] = "Engineer"
a[1][0] = "Dipu" , a[1][1] = "Das" , a[1][2] = "Merchant"
a[2][0] = "Vinu" , a[2][1] = "Lal" , a[2][2] = "Bussiness"
**************************************************************/
// Here I have assigned my values, Is this the correct way of assigning values ??
pbstr[0] = SysAllocString(OLESTR("Ram")); // for a[0][0]
pbstr[1] = SysAllocString(OLESTR("Dipu")); // for a[1][0]
I think, you have messed up here.
Using Arrays of Strings[^].
This link will give you idea, how to use the array.
|
|
|
|
|
Hi Prasad,
Thank you Very much
George
|
|
|
|
|
Hi
How to start a interactive process(say calc.exe) on a remote machine USing WMIon Windows XP
Thanks In Advance
abhi
|
|
|
|
|
Hi all,
I want to develop add-in for OUTLOOK, In that for event handling use IDispEventSimpleImpl Interface, and declare handler function (fn) for the specified event using SINK_ENTRY_INFO, but whenever that particular event occurs my handler function gets call two times! why it happens so? I want to call it only single time....
MY code is.....
class ATL_NO_VTABLE CConnect :
public CComObjectRootEx<ccomsinglethreadmodel>,
public CComCoClass<cconnect, &clsid_connect="">,
public IDispatchImpl<addindesignerobjects::_idtextensibility2, &addindesignerobjects::iid__idtextensibility2,="" &addindesignerobjects::libid_addindesignerobjects,="" 1,="" 0="">,
public IDispEventSimpleImpl<1,CConnect,&__uuidof(Outlook::ExplorerEvents)>,
{
public:
BEGIN_SINK_MAP(CConnect)
SINK_ENTRY_INFO(1,__uuidof(Outlook::ExplorerEvents ),0xf002,onFolderChange,&OnSimpleEventInfo)
END_SINK_MAP()
public:
//type defination to avoid compilation 'ambigous call' errors
typedef IDispEventSimpleImpl<1,CConnect, &__uuidof(Outlook::ExplorerEvents)> ExpEvents;
void __stdcall onFolderChange();
}
Any idea about this, please suggest me...
Thanks & Regards,
Shyam
Reply
Reply
Shyam Gaikwad
|
|
|
|
|
HI all.
i want return the array in COM project.but i don't know how i should Write the code. Thank you.
|
|
|
|
|
Maybe you could return a variant with safearray
|
|
|
|
|
How to write a program in MFC BY CREATING A BUTTON BY CLICKING THAT BUTTON APOP UP SHOULD DISPLAY THAT INTERNET IS WORKING OR NOT I WANT SOURCE CODE
pradeep
|
|
|
|
|
Hi,
I have a component in vb.net. In this component i have app.config file from which I am reading the connection settings and settings for enterprise libarary exception handling.
If I use this component form .NET application it works fine but when I try to use this component from asp by registering the dll, the copmponent is not able to read any settings from app.config file.
Please provide solution to this problem i searched everywhere but not able to get the working solution.
|
|
|
|
|
To my knowledge a DLL cannot have app.config
because app.config is only for individual applications (like windows / console)
i.e. it should not be a DLL
however a DLL can read ....
for example : 1. sum.dll is reffered in math.exe
2. then sum.dll can read from app.config of math.exe
3. sum.dll cannot have it's own app.config.
|
|
|
|
|
HI all,
please if any1 could provide me with required codes for locking keyboards and mouses of computers in the same LAN using Java and under Windows XP Os.
As I am a student working on my senior project, which is 2 implement an instructor control computer, that can control students' computers connected through LAN (I will work on two Pc's only,instructor and student). the teacher can lock their keyboards and mouses, and broadcast his/her desktop screen on their monitors.
Thank you.
|
|
|
|
|
I wrote a dll by C#, and the issue is that I don't know how to call this dll from vb6.
Thank all.
|
|
|
|
|
try "tlbexp" . in vb6 , you can fin it in object reference.
|
|
|
|
|
Hi, all!
I have a following problem, and i can't find a right solution.
Description:
There is a COM server written on C++ and it works through IDispatch and it does't have a TYPELIB. And from another side there is a COM client developed on C#. Through LATE BINDING it uses a COM server
and COM server sends different events to client, but i can't implement COM event handling mechanism.
Please, anybody can help me?!
Thanks in advance!
|
|
|
|
|
If you have a look in the registry below HKEY_CLASSES_ROOT\CLSID\{<clsid of the server>}, does it contain a key named 'TypeLib'?
If not, do you have an .idl file where the interfaces of the server are defined?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
maybe you could check whether server app contains typelib using vs2005 ,like wlm.
|
|
|
|
|
Hi all,
I am been having trouble with finding an answer to this question but here goes:
Is there any way to write to MSWORD without automation through ASP.NET in C# (maybe write to an existing word document without opening it)?
I am pulling my hair out! I have tried adding IUSR, ASPNET to the web server, I have tried Identity Impersonate = True in the web.config.
My code for opening word looks like this:
object isVisible = true;
object readOnly = true;
I get a Macro storage error on the open statement. I have put a lot of time into figuring this out and I really dont want to do a TOTAL 180.
wordDoc = WordObj.Documents.Open2000(ref fileName, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible);
I appreciate any ideas or suggestions given!
|
|
|
|
|