|
I would like to copy file from local to remote machine using WMI in C++. Not quite sure how to do this.
According to MS doc, "Win32_Directory" can be a good candidate. Anybody got idea? Thanks in advance.
Jack Rong
|
|
|
|
|
|
Hi Guys,
I need to call a com dll from another com dll.First com dll would be in VC++ 6.0 and second would be in VC++ 2008. This First Com Dll would call VC++ 2008 com dll. Going further I need to create a VB6.0 client to call vc++ 6.0 com dll.
I tried it but facing problem while calling VC++ 2008 com dll from VC++ 6.0 com dll. Do you guys have a solution for this. or simply tell me how to call a com dll from another com dll? I think this will do the needful.
regards,
.......
|
|
|
|
|
Hi,
i have an ActiveX dll(using ATL) in webserver and i included it in my html page ..
and when client requests for that html the dll gets installed(registered) with his permission but the issue it"s getting successfully installed on Admin machine..but in non-admin machine even the message box that prompts to install dll is not displaying.....is there any limitation for non-admin...
when itry to register the dll using regsvr32 in nonadmin it works fine but i was unable to do it thru html...
I searched for implementing REGfreeCOM but i could"nt ..
pls help me out...
|
|
|
|
|
|
I have a class which is using the float as template parameter . The code compiles correctly in VC6.0. But in VS2008 float is not allowed as template paramemter. So i am using the float pointer(please let me know if there is any alternative other than using int as data type). when I compile the code I get following errors at multiple places
syntax error : missing ',' before identifier 'lowerBound'
syntax error : missing ',' before identifier 'upperBound'
'tBoundedType' : too many template arguments
How can fix this? what is error in this class declaration
here is my float pointer class declaration
#ifndef tBoundedType_h
#define tBoundedType_h
#define CLASSID_TBOUNDEDTYPE 27
template<float float="" upperbound="">
class tBoundedType
{
public:
tBoundedType(); // Sets the value to lowerBound.
tBoundedType(float * value);
// An Ensure fails if value is not between lowerBound and upperBound.
// tBoundedType<float float="" upperbound=""> & operator=(float *);
// An Ensure fails if value is not between lowerBound and upperBound.
static float LowerBound() { return lowerBound; }
static float UpperBound() { return upperBound; }
// operator type() const { return mValue; }
// Stream me
//virtual void PerformIO(tNSStream *);
virtual long GetClassId() const { return CLASSID_TBOUNDEDTYPE; }
long GetVersion() const { return 1; }
protected:
float mValue;
};
template<float float="" upperbound="">
tBoundedType<lowerbound,>::tBoundedType()
: mValue(*lowerBound)
{
}
template<float float="" upperbound="">
tBoundedType<float float="" upperbound="">::tBoundedType(float * newValue)
: mValue(*newValue)
{
Ensure(mValue >= *lowerBound);
Ensure(mValue <= *upperBound);
}
template<float float="" upperbound="">
tBoundedType<float upperbound=""> & tBoundedType<float float="" upperbound="">::operator=(type newValue)
{
Ensure(newValue >= lowerBound);
Ensure(newValue <= upperBound);
mValue = *newValue;
return *this;
}
template<float float="" upperbound="">
void tBoundedType<float float="" upperbound="">::PerformIO( tNSStream *stream )
{
//int version = GetVersion();
//stream->DoIO( version );
//stream->DoIO( mValue );
}
|
|
|
|
|
When you post code, please tick the "Auto-encode HTML when pasting?" check-box. Doing that escapes the < sign, making your template code readable - which it really isn't now.
Hemant kulkarni wrote: please let me know if there is any alternative other than using int as data type
C++ templates only allow types and integral constant values as template parameters - so, no alternative, really...unless you encode the floating point values as integral values.
Repost your code with the "Auto-encode HTML when pasting?" checkbox ticked and we may be able to help you with your problem.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi,
I have written a win32 dll in VC++ 2008. I am calling this DLL from VC++ 6.0 com dll.this com dll
has vb exe as client. when i am calling running prog through com dll everything working fine,
however, when i try to run through vb output is not coming neither any error.
can someone suggest me what's wrong with the application?
however same vb exe is working through com dll. Any guess?
|
|
|
|
|
It's tough to post any comment on your question, and also i'm unaware of these type of questions. I think the only way by which anyone might solve their problem of these type by changing the remote hosting provider, which can provide you full time support 24/7, anywhere and anytime.
modified on Thursday, January 20, 2011 6:04 AM
|
|
|
|
|
Hi All,
I am facing problem while calling a COM DLL built in visual studio 2008 VC++ from a COM DLL built in visual studio 6.0,VC++.
Can someone tell me how to call this DLL from VS6.0 dll? DO you have any practical example? Please share.
regards,
Vatsa
|
|
|
|
|
rana ray wrote: I am facing problem while calling a COM DLL built in visual studio 2008 VC++ from a COM DLL built in visual studio 6.0,VC++.
What problem? Please share...
Given how COM works, it doesn't matter if the COM DLL is built in VC++2008, VC++6 or VB6 - it gets called the same way whichever you use to build hte DLL or call it.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
remember I am calling a dll from another dll.
my vs 6.0 com dll is not identifying VS 2008 com dll's interface.
I have included my vs2008's _i.c file and header file as well in my VS 6.0 com dll.
Is there any other things which i need to do? sharing code is not possible for me as of now.
|
|
|
|
|
rana ray wrote: remember I am calling a dll from another dll.
Should make no difference.
rana ray wrote: my vs 6.0 com dll is not identifying VS 2008 com dll's interface
There are many reasons why that might happen. Have you checked you can access the VS2008 COM object from other clients?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
OK, so when you call it from the VS2008 DLL, what function call fails (is it CoCreateInstance possibly) and what error status does it return?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
It is throwing compilation errors. Not identifying Interface identifier.
|
|
|
|
|
Right, that's kind of an important detail.
If I were you, I'd take note of what Roger said, and use #import[^] to get a reference to the VS80 DLLs. The code generated by MIDL has changed enough between VC6 and VS2008 that I wouldn't guarantee that VS2008 MIDL code will compile under VC6.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
First of all: are we talking about a compile time error or a runtime error?
rana ray wrote: my vs 6.0 com dll is not identifying VS 2008 com dll's interface.
I have included my vs2008's _i.c file and header file as well in my VS 6.0 com dll.
What does this mean?
How do you "import" the COM server you're trying to use? Are you using the #import statement? If you are: what does it look like?
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
As there are 2com dll. I am using one com dll to import other. so in first one i have used cocreateinstance to instantiate my vs 2008 com dll.
|
|
|
|
|
The class name for the WMP ActiveX control is with the name of WMPVideoWindow.
I can use MSAA tech to retrieve the IAccessible* and IServiceProvider*, but I don't know how to get the WMP related interfaces.
Who can give me some ideas?
thanks.
|
|
|
|
|
Hello All,
I am trying to convert a list of Strings in LPWSTR* array. I am using the following way to convert it. But here the problem occurs in the returning array items. It contains all the elements same in the array. I found the problme is due to memset() which updates the memory address everytime same as earlier. Please help me out----
for(DWORD i = 0; i < itemIds->Count; i++)
{
ATL::CComBSTR itemWChar;
itemWChar = ::GetAtlBstr(itemIds[i]);
WCHAR _itemWChar[_MAX_PATH];
memset(_itemWChar, 0, sizeof(_itemWChar) / sizeof(_itemWChar[0]));
memcpy(_itemWChar, static_cast<bstr>(itemWChar), itemWChar.ByteLength());
items[i] = _itemWChar;
}
ANURAG VISHNOI,
Sr. Software Engineer,
|
|
|
|
|
Firstly, make sure you have the checkbox labelled "Auto-encode HTML when pasting?" ticked before you paste code. That way, your template parameter lists won't get hidden.
Secondly, your problem is that you are assigning the same string to each element of items. Nothing to do with memset.
Try this:
for(DWORD i = 0; i < itemIds->Count; i++)
{
ATL::CComBSTR itemWChar;
itemWChar = ::GetAtlBstr(itemIds[i]);
WCHAR* _itemWChar = new WCHAR[itemWChar.ByteLength()];
memset(_itemWChar, 0, sizeof(_itemWChar) / sizeof(_itemWChar[0]));
memcpy(_itemWChar, static_cast<bstr>(itemWChar), itemWChar.ByteLength());
items[i] = _itemWChar;
}
This allocates a new block of memory for each BSTR copy (don't forget to delete[] it!). BTW - if your BSTRs definitely contain wide characters, then you should probably use this code instead:
for(DWORD i = 0; i < itemIds->Count; i++)
{
ATL::CComBSTR itemWChar;
itemWChar = ::GetAtlBstr(itemIds[i]);
WCHAR* _itemWChar = new WCHAR[itemWChar.Length()+1];
wcsncpy(_itemWChar, static_cast<bstr>(itemWChar), itemWChar.Length());
_itemWChar[itemWChar.Length()] = 0;
items[i] = _itemWChar;
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hello Stuart,
You really put my life in heaven.
Thanks Alot dude.....
ANURAG VISHNOI,
Sr. Software Engineer,
modified on Thursday, April 23, 2009 5:49 AM
|
|
|
|
|
How to compute difference and intersection of two sets?
There are functions set_difference and set_intersection which requires two pairs of iterators of source sets and output iterator of resulting set. Here, set can be any sorted container with incrementable iterator. There is another requirement that the output should be large enough to contain the destination range.
For STL-set, however, you cannot set the size of it and using an empty set as output leads to assertion. In fact, output iterator of destination empty set is equal to end() and incrementing iterator does not add elements to a set.
So how to compute this?
|
|
|
|
|
Use std::inserter[^] or std::back_inserter[^] for the output iterator. That causes the items to be inserted into the container without having to know what size it should be before you've constructed it.
If you're using a vector or list as the output, I'd use std::back_inserter. For a set, std::inserter is required. Here's an example:
#include <vector>
#include <set>
#include <iostream>
#include <algorithm>
#include <iterator>
int main()
{
std::set<int> a, b, c;
a.insert(1);
a.insert(2);
a.insert(3);
a.insert(4);
b.insert(2);
b.insert(4);
b.insert(5);
b.insert(7);
std::vector<int> d;
std::set_intersection(a.begin(), a.end(), b.begin(), b.end(), std::inserter(c, c.end()));
std::set_intersection(a.begin(), a.end(), b.begin(), b.end(), std::back_inserter(d));
std::copy(c.begin(), c.end(), std::ostream_iterator<int>(std::cout, " "));
std::copy(d.begin(), d.end(), std::ostream_iterator<int>(std::cout, " "));
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|