|
Hi,
Can anybody help me to get Icon details like its name, target path, working directory whenever it is double-clicked to run the application. This is be using Windows API or in C#.
I have already used IShellLink Interface but its been hard-coded for icon name. Suppose the user changes desktop icon name then also coding should be able to change its working directory. This can be done if I can check the existence of the icon.
Regards.
|
|
|
|
|
I noticed you are crossposting.
This question already got answered on the C# forum.
C# Forum post[^]
WMLast modified: maandag 4 september 2006 10:26:15 --
|
|
|
|
|
this is the problem;
Write a program in C that finds randomly generates an n x n adjacency matrix. Have your program print the adjacency matrix, the number of edges, the number of loops, and the degree of each vertex.
|
|
|
|
|
This is the managed C++ forum. Please post it in Visual C++/MFC instead.
Best,
Jun
|
|
|
|
|
yeah and tell 'em do do their own homework
bryce
|
|
|
|
|
I've been working on a memory usage logging system, and came upon this strange preprocessor bug appearing while using __VA_ARGS__ in a specific way.
This is the source that should but doesn't compile on VC++ 8.0 (included is also a hacky workaround):
<br />
#include <new.h><br />
<br />
template<class T> void * internal_alloc( int locationID, int lineNumber, const char * pFileName )<br />
{<br />
return 0;
}<br />
<br />
#define internal_new( __obj_type, ... ) new( (internal_alloc<__obj_type>(__COUNTER__, __LINE__, __FILE__)) ) __obj_type( __VA_ARGS__ )<br />
<br />
void main()<br />
{<br />
int * pTest1 = internal_new( int );
int * pTest2 = internal_new( int, 1 );
<br />
<br />
}<br />
It looks like the __VA_ARGS__ solver removes the wrong comma in 'no arguments' scenario
I wonder how it works on some other compiler?
|
|
|
|
|
Eek, now I see that I accidentally posted to 'managed c++' instead of 'Visual C++ / MFC.
|
|
|
|
|
Hi,
I was using gmtime() on WinCE with Dinkumware libraries. It returned local time instead of UTC. Although I can convert it to UTC by calling GetTimeZoneInformation, still wondering why that is, and if there's any other function can be called?
Thanks!
d8
|
|
|
|
|
Hello,
I am new to C++/CLI programming, and I can't figure out why the following code can't be compiled :
<br />
ref class MyClass<br />
{<br />
};<br />
<br />
int main ( void )<br />
{<br />
MyClass instance1;<br />
System::String instance2;
<br />
return 0;<br />
}<br />
The compiler outputs an error when i try to allocate a String object as an automatic variable : "C3149: 'System::String' : cannot use this type here without a top-level '^'."
As the problem doesn't appear with my home-made ref class, my actual question is : is there a way to prevent a class from being instantiated as an automatic variable ?
Regards,
Julien
|
|
|
|
|
juju_hli wrote: As the problem doesn't appear with my home-made ref class, my actual question is : is there a way to prevent a class from being instantiated as an automatic variable ?
String, array, and delegate objects cannot be declared using stack semantics (it's a compiler enforced restriction).
|
|
|
|
|
Thank you for this quick reply
|
|
|
|
|
i have recovered all messages from a dbx file.
i want to put back into a dbx file throght programming not to drag drop.
Parshant
|
|
|
|
|
Hi all.
I have a listview handle and some item index. I want to select it via windows api.
Can someone help me?
Thx in advance.
Best Regards,
Marco Alves.
|
|
|
|
|
I have an application whose shortcut is placed on the desktop. Now whenever i double-click that icon, I want to get the information for that icon like Icon name, Icon target path, Icon working directory. The reason behind this is from one of the functionality the working directory changes for the application. So through Windows API or in C#/C++ I want to change the working directory for the icon which is double-clicked.
Plz guide me soon and at the earliest, if possible.
Regards.
Chilly
|
|
|
|
|
you can resolve an icon information using the IShellLink interface methods: Resolve(), GetPath(), GetDescription() etc. For this u need to pass the sortcut path. But for resolving it on icon click, u may need to write a mouse hook dll or a shell extension.
cheers..milton kb.
|
|
|
|
|
Actually when we use dll's then we use #import key word rather than we use #include key word, so what ll be the difference between them.
|
|
|
|
|
|
Hello Dear Friends,
I face a strange problem with GroupBox Controls in .Net 2
This is a story:
I made a custom control inherited from GroubBox Control. I've put some other ocntrols in this new control and I've added them by this statement in my new control: this->Controls->Add(some .NET Control).
This is a problem:
When I set Anchors or Docks to my controls it dosn't work. BTW It seems that the anchored to left and top and I can't change them noway. (The parent control i.e. Custom GroupBox works perfect and change it's size correctly but it's childrens no!)
Every hint in appriciated.
Wish you luck.
Mamad
|
|
|
|
|
I don't understand why, but it's writing garbage instead of the text. When i use CFile.write, it's working correctly. anyone knows why.
also is there a tricks to add null at the end of a string? i tried this:
iEnd = strlen(cInfo);
cInfo[iEnd -1] = '\0';
but it's never written into the file, so i'm assuming it's not in the string?
|
|
|
|
|
I defined an enum like that:
public enum class FontQuality : __int32
{
Default = DEFAULT_QUALITY,
Draft = DRAFT_QUALITY,
Proof = PROOF_QUALITY,
NonAntiAliased = NONANTIALIASED_QUALITY,
AntiAliased = ANTIALIASED_QUALITY,
ClearType = CLEARTYPE_QUALITY,
ClearTypeNatural = CLEARTYPE_NATURAL_QUALITY
};
Now I'm using it in C# library and the compiler warns me that it is not CLS compliant...
Why is that? (and how to fix it?!)
When I define a similar enum in C# I have no CLS compliance issue...
|
|
|
|
|
I have VS2005
Experimenting with header file is quite difficult because most of the time I do so VS2005 eat up 100% CPU and, slowly, all the memory as well (1GB, 2GB, 3GB, ... piou...... (reboot button))
Now I have been told that header file should speed up my compilation (which is rather slow even though the Managed C++ project is small)
Because I include <windows.h> in many headers (needed to define some enum from Windows constants) I though: OK: let's #include <windows.h> in stdafx.h.
But I have a doubt.. does it makes any sense to include a precompiled header in other headers?
|
|
|
|
|
Hi, I have a native abstract base class from which a number of child classes inherit from. The abstract base class has a pure virtual function that is overridden in each of the child classes.
My problem is this, how can i write managed wrapper classes for the base class and child classes whilst maintaining the ability to declare a base class pointer and to later instantiate a child class with it?
I cannot instantiate the base class because it a pure base class (I would not want to anyway) and if I wrap each child class individually then I will no longer have runtime polmorphism.
Am I being thick or is it not possible? Any advice greatly appreciated. Thanks
zenzero
|
|
|
|
|
Declare a class with a base class pointer and a constructor having a base class pointer parameter ... likes auto_ptr
|
|
|
|
|
Initial Clarification: I need different memory stack (where addresses are stored), Not a stack container as in similar to a linked list container.
I need to create a new memory stack when different command line parametrers are used. It is to simulate a buffer overflow problem and our assignment specs say when a different user is specified, a different stack is created so a different attack is needed(a different amount of overflowing data).
Quote from ass specs
"It is required that each of usernames (Alice, Bob, or Chris) is associated with a different memory stack. You need to provide an attack for each of them. As a result, three buffer overrun instances and their associated attacks should be provided in your report. It is up to you for the coding approach."
I can call my program :
myProg.exe Alice
myProg.exe Bob
What I have done is implement each user into a different function. This doesnt force me to use a different attack for each user (same attack works for each user.)
I then put some initialised local variables inside bob() function, to make it different to the Alice() function. This didnt change what I wanted either.
I also created a few dummy functions which just passed the control to then next function to eventually start the Bob function. but this didnt make it any different from just calling bob straight out. (if that makes any sense)
I read this (and many other) websites to try and understand how variables and functions are alocated to the stack
http://users.actcom.co.il/~choo/lupg/tutorials/unix-memory/unix-memory.html#c_stack
But I obviously still dont understand how addresses are allocated to the stack to make it different for different command line parameters.
Ive spent a day and a half trying to solve this problem, the rest of my code does what I want
Can someone please clarify this or give me an example of how to create a different stack for different parameters.
Thanks in advance
|
|
|
|
|
Am I dreaming, or is there a way to add a labels to a document and print the document, so you get little squares of text all over the page?
Thanks
|
|
|
|