|
How about searching on CP for single instance application articles? Then you'd have found this one[^], for example.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hai all ,
I have created an application in VC++ using VS2008 in a development machine which runs on Vista, now i need to run that application in a target machine which runs on windows XP SP2 which does not have vc++ dlls or any thing.
i need a help for redistributing the dependent dlls for the application so that it should run well in target machine.
this is the manifest file created for the application ...
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.4053' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly>
<assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50727.762' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
</dependentAssembly>
</dependency>
</assembly>
can any one tell what all the files needed to be redistributed with my application
thanks in advance,
Jerin
|
|
|
|
|
Your problem is not simple unfortunately.You would better first use Dependancy Walker to detect dll dependancies and next test your app on guest OS running under Microsoft Virtual PC or VMWare.
Life is a stage and we are all actors!
|
|
|
|
|
Hi
I would like to find function which can chanege a value in data base.
Something like GetFiledValue but which writes value into record
thanks in advance
Rafal
|
|
|
|
|
I can not find a good multiple installation software, so I want to do some test to determine if I can setup installation pack myself:
First question is:
How to add Items to Windows start menu and link user click to related file (exe, chm etc.)?
|
|
|
|
|
Ummm - create a shortcut to the exe or chm in a folder in the start menu - either the All Users start menu (for an 'All Users' install) or the current users start menu. The start menu location can be retrieved with SHGetSpecialFolderPath[^]
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
you can send email to me i'm the author kyzhao
|
|
|
|
|
I saw your post on codeproject, and was wondering if you had resolved it. I am having the same issue. My hello world example along with others works fine as an executable, but when I deploy it as a .dll, I can't seem to get it to work.
What I did was this:
The project that contains the CUDA code and generates a .dll builds fine.
CLI project references this unmanaged dll and is essentially just a managed wrapper.
C# project references the managed .dll.
Compiles fine, but i get a runtime file not found error.
When I use Dependency Walker (a nice freeware app) it shows me that MSVCR90D.DLL and DWMAPI.DLL cannot be found, which is strange
because another reference to MSVCR90D.DLL shows the file as found.
Thanks.
|
|
|
|
|
Hi
Following code is from Microsoft (http://support.microsoft.com/kb/243285[^]).
It compiles OK under "debug" using VS2005. It generated warning message under "release".
while ((DWORD)lpHeader &lt; (DWORD)(((LPSTR)lpStart) + size) &amp;&amp; pt != NULL) ;
warning C4311: 'type cast' : pointer truncation from 'LPTTPOLYGONHEADER' to 'DWORD'
warning C4311: 'type cast' : pointer truncation from 'LPSTR' to 'DWORD'
void DrawT2Outline(HDC hDC, LPTTPOLYGONHEADER lpHeader, DWORD size)
{
WORD i;
UINT cTotal = 0;
LPTTPOLYGONHEADER lpStart;
LPTTPOLYCURVE lpCurve;
LPPOINT pt;
POINTFX ptStart;
DWORD dwMaxPts = size/size of(POINTFX);
DWORD dwBuffSize;
dwBuffSize = dwMaxPts *
sizeof(POINT) *
3;
lpStart = lpHeader;
pt = (LPPOINT)malloc( dwBuffSize );
while ((DWORD)lpHeader < (DWORD)(((LPSTR)lpStart) + size) && pt != NULL)
Best regards,
|
|
|
|
|
Well, both of these messages are saying that the original pointers LPTTPOLYGONHEADER and LPSTR are longer than a DWORD, hence the truncation. So there is something in the release version that is set different from the debug. A simple check using sizeof() for each of these types will tell you what size the compiler thinks they should be. That, and checking your compiler project settings for each build type.
|
|
|
|
|
Pointers should be cast to DWORD_PTR , not DWORD . DWORD_PTR changes to match the pointer size of the platform (that's what the "PTR" part means).
--Mike--
Dunder-Mifflin, this is Pam
|
|
|
|
|
transoft wrote: while ((DWORD)lpHeader < (DWORD)(((LPSTR)lpStart) + size) && pt != NULL)
I have just reread this and it seems to me that your casts are redundant. lpStart and lpHeader are both LPTTPOLYGONHEADER types, so they should be comparable without the need for casting. Try rewriting as
while (lpHeader < (lpStart + size) && pt != NULL)
|
|
|
|
|
I'm recently learning C#. In C# you can pass parameters by value or by reference, and as you know, there are value types and reference types in C#.
I don't know if reference in C# means the same thing as in C++. But I think passing a reference type by reference in C# is similar to passing a pointer "by reference" in C++ (Reference to Pointer). As in both cases, the callee can change the values of the object’s state data as well as the object the ref type/pointer is referencing/pointing to.
What do you think?
I've written a program in C++ using "Reference to Pointer".
#include <iostream>
#include <string>
using namespace std;
class Person
{
private:
string name;
public:
Person(string s)
{
name = s;
}
Person()
{
name = "";
}
void SayHello()
{
cout << "Hello, my name is " << name << "!" << endl;
}
};
void Swap(Person *& a, Person *& b)
{
Person *temp;
temp = a;
a = b;
b = temp;
}
int main()
{
Person *p1 = new Person("Alice");
Person *p2 = new Person("Bob");
cout << "Before swapping:" << endl;
p1->SayHello();
p2->SayHello();
cout << endl << "Memory address of *p1:" << p1 << endl;
cout << "Memory address of *p2:" << p2 << endl;
Swap(p1, p2);
cout << endl << "After swapping:" << endl;
p1->SayHello();
p2->SayHello();
cout << endl << "Memory address of *p1:" << p1 << endl;
cout << "Memory address of *p2:" << p2 << endl;
delete p1;
delete p2;
return 0;
}
This program swaps the objects that p1 and p2 points to by passing them to Swap() by reference.
However, if I define Swap() like this:
void Swap((Person *) &a, (Person *) &b)
the compiler would display some error messages.
Swap.cpp(27) : error C2065: 'a' : undeclared identifier
Swap.cpp(27) : error C2065: 'b' : undeclared identifier
Swap.cpp(28) : error C2448: 'Swap' : function-style initializer appears to be a function definition
Swap.cpp(47) : error C3861: 'Swap': identifier not found
I really don't know why there would be errors. Why are those two definitions different?
Finally, I wonder if you know how to do the same swapping job in Java. As you know, in Java I can only pass parameters by value. Do you have any solutions?
|
|
|
|
|
You really don't need a reference to a pointer here.
It can be a reference to an object.
void Swap(Person& a, Person& b)
{
Person& temp = a;
a = b;
b = temp;
}
Then in the above case it would be called as -
Swap(*p1, *p2);
But objects need not be always created using new like in C#.
In C++ you can create objects on the stack using the syntax -
Person p1("Alice");
Person p2("Bob");
Now the Swap call would be -
Swap(p1, p2);
«_Superman_»
I love work. It gives me something to do between weekends.
modified on Friday, September 18, 2009 10:18 AM
|
|
|
|
|
«_Superman_» wrote: void Swap(Person& a, Person*& b)
Superman, you have one more * than common men, of course.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
The perils of HTML editing.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Thank you for replying.
Yes I know I can use a ref to obj directly.
But in C#, classes can only be ref types.
If I pass an object to a method, I'm passing a ref type.
And I can pass this ref type either by value or by ref (using the ref kerword).
I don't know if C# reference is the same as C++ reference, but I think passing a ref type by value/ref in C# is similar to passing a pointer by value/ref in C++.
If I pass a ref/pointer by ref, I can change the state of the obj it references/points to, and I can reference/point to other objects.
My questions are:
Why void Swap((Person *) &a, (Person *) &b) doesn't work?
And how do I write a similar Swap() method using Java? Can I?
|
|
|
|
|
lhyblue wrote: But in C#, classes can only be ref types.
This isn't C#, it's C++. A C++ reference is more like the ref keyword thing. For example, the following function definition will modify the parameter value that's passed in, such that the underlying variable is altered:
void Modify(int & a) { a += 2; }
lhyblue wrote: I don't know if C# reference is the same as C++ reference, but I think passing a ref type by value/ref in C# is similar to passing a pointer by value/ref in C++.
No. Passing a C# ref type by value is like passing a C++ object by value, by const reference or by const pointer. Passing a C# ref type by reference is like passing a C++ object either by non-const reference or by pointer.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Stuart Dootson wrote:
No. Passing a C# ref type by value is like passing a C++ object by value
I disagree: C++ makes a copy of the original object, while C# always pass a reference of the original object.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Mmmmmm - if that's the case, then C# always passes ref types by reference - what's the difference between ref and non-ref.
Can we just agree that C# is fundamentally wrong and be done with it
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Stuart Dootson wrote: if that's the case, then C# always passes ref types by reference
Nope, C# (like Java ) pass all objects as references, (the reference to the object is passed by value). On the other hand, C++ makes a copy of an object passed by value.
Stuart Dootson wrote: what's the difference between ref and non-ref.
void foo(Goo goo)
can change the state of the object referenced by goo (similar to C++ reference or pointer to the object).
void fooWithSuperpowers(ref Goo goo)
can change goo itself, i.e. goo may be a reference to another object after function call (similar to a double indirection in C++ ).
Stuart Dootson wrote: Can we just agree that C# is fundamentally wrong and be done with it
Stuart Dootson wrote: Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
Java, C#, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
FFY
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Give me Haskell, where all data is immutable and we don't need to worry about passing things by value, reference, pointer or anything else - oh, and it's so lazy that it might just decide not to pass anything anyway, if it decides it's not required.
PS - thanks for explaining ref vs non-ref - I guess in C++ that is a reference to a pointer vs. a pointer?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Stuart Dootson wrote: I guess in C++ that is a reference to a pointer vs. a pointer?
Yes a reference to a pointer (or a pointer to a pointer) vs a pointer.
BTW Real men (aka Klingon programmers), you know, don't use C++ or C# sissy features like references, they go straight with pointers.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
modified on Saturday, September 19, 2009 6:38 AM
|
|
|
|
|
Na - real men are programming in assembly, so it's all just (untyped) addresses...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|