|
now i use vc++ 6 to control ms word,i want a table's cell has a DiagonalDown line,
maybe SetBorders() should be used, but i don't know the usage method
how can i set DiagonalDown line in a ms word table's cell
thanks a lot
|
|
|
|
|
Hi,
(my first post on CodeProject )
I am unable to use GetPtrEx and GetPtrEx2 function versions.
I get Unhandled exception.
Please tell me why...
class CTest
{
private:
char *a;
public:
CTest(int n=10)
{
a= new char[10];
a="george";
}
virtual ~CTest()
{
}
char * GetPtr()
{
return a;
}
void GetPtrEx(char **ptOut)
{
ptOut=&a;
}
void GetPtrEx2(char *ptOut)
{
ptOut=a;
}
};
int _tmain(int argc, _TCHAR* argv[])
{
CTest obj;
char *rx=NULL;
obj.GetPtrEx(&rx);
cout<<"sir="<
|
|
|
|
|
The parameters need to be passed as references (e.g., void GetPtrEx2(char*& ptOut) ).
As it is, you're making a local copy of the parameter in the function bodies and are manipulating that local copy. The variable in your main function is unchanged after calling GetPtrEx because only the local copy inside the accessor was modified.
In order to have changes inside the accessor preserved and made available to the caller, the parameters must be passed as references. In effect, this passes the address of the original variable, rather than making a local copy. Changes made in the accessor will affect the original copy of the variable declared outside the accessor.
Also, in the future, use the 'code block' button above the edit window when posting code. It makes it much more readable; a lot of people here won't even respond to a message loaded with unformatted code.
|
|
|
|
|
CTest(int n=10)
{
a = new char[10];
a = "george";
}
This is incorrect, you are merely overwriting the pointer in a; you need to copy the string to 'a' via strcpy() or similar. Also the constructor takes a value that is never used.
void GetPtrEx(char **ptOut)
{
ptOut = &a;
}
This changes the local copy of ptOut; it should be *ptOut = a; . Similarly GetPtrEx2() does nothing useful.
|
|
|
|
|
my question as follow:
there're various icons on the desktop, which are system icons, app icons, icons created by right-button and so on;
why only icons created by right-button can found on the path of desktop?
thank you very much, 兄じゃん
|
|
|
|
|
I'm most likely not your brother, and i also am not sure what you exactly mean by your question, but not everything you see on your desktop are filesystem objects, "My Computer" for example or "My Network places" aren't filesystem objects, you won't find them if you look at the directory listing of your desktop. I hope this answers your question.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
thanks, since they are not filesystem objects, how explore.exe display them.
if you setup one game, for ins, World Of Warcraft, it'll produce one icon on the desktop,
this also is not filesytem object, is this?
|
|
|
|
|
Not only filesystem objects can be displayed by the shell, maybe read this[^] for more info.
However, games usually place links to your desktop to make it easier for the user to start them, links ARE file system objects, with .lnk as extension (so these do appear in a folder listing), i believe the shell uses the file the link is referring to to give an icon to it (so for example if the link "points at" a txt file, then you will see a text file document icon, or if the link points at WOW's executable, then the link will get the icon of WOW), also, unless you dissable this feature (i think you can do that) the shell will place a small arrow icon in the corner of the bigger icon to show you it is a link at another object and not the object itself.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
|
Sorry, i can't read what you sent there, i tried a few encodings in my browser but nothing produced anything human-readable to me, but if it is anything than english or german (or hungarian), i won't understand it anyways.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Aha, it's japanese sentence and its meaning is thanks very much!
I just am a freshman in the code-world, and need to keep up with you.
|
|
|
|
|
Ah, yourwelcome, glad i could give some help. Please always use english if you post anything here on this forum so everyone can understand, the more people understand your problem the more help you can expect. And welcome to the code-world.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
This is not a C++ question. However, I suspect you are talking about their visibility in Windows Explorer, which is controlled by the settings you have selected. Look at the Tools -> Options selections on the menu.
|
|
|
|
|
i am shamed for misleading you, giving me another try to repeat my question please.
there are My Computer、My Document、Bit-Bullet、Application Quick-Link icons on the desktop of ms-operation system,
and i want to retrieve the path that icons related, for ins, Warcraft.exe, which links to D:/Program/Warcraft/Warcraft.exe.
can you understand me? i am shamed
modified on Sunday, November 15, 2009 10:29 AM
|
|
|
|
|
sunen wrote: i want to retrieve the path that icons related, for ins, Warcraft.exe, whick links to D:/Program/Warcraft/Warcraft.exe.
OK, I think I understand what you are trying to do. These items are not icons but links, commonly known as shortcuts. I think you can access their properties through the IShellLink COM interface, but I am not sure of the exact steps required. I would suggest you try searching with Google or Bing to see if any sample code exists.
|
|
|
|
|
|
Didn't you try that same suggestion yesterday?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
i m unable to run openCV program in VS C++ !!! please help.....
csetopper_bhanu
|
|
|
|
|
csetopper_bhanu wrote: i m unable to run openCV program in VS C++
Why?
csetopper_bhanu wrote: please help
How?
|
|
|
|
|
Hi
I am trying to install an application in USB which makes USB as a read only i.e. it should be working as a dongle. Pls let me know how it can possible using vc++.
Thanks
SNI
modified on Tuesday, November 17, 2009 3:50 AM
|
|
|
|
|
SNI wrote: Pls let me know how it can possible using vc++.
Specifically what trouble(s) are you having?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I am trying to make USB as a dongle. I am wondering how it can be achieved using VC++ or any other languages. Is USB dongle is same as USB Tocken?
SNI
|
|
|
|
|
Hi.
I'm trying to find out with this.
I have to change every single xls to csv manualy. Any sugestion, how can I do this in C++? There must be something! I'm a beginer in C++, want to lern it. Any hint welcome!
Many thanks.
pswierq
|
|
|
|
|
pswierq wrote: I have to change every single xls to csv manualy.
Rename or convert?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|