|
|
how to assign a tooltip to a push button in c++
plz help
dghdfghdfghdfghdgh
|
|
|
|
|
There is a thing called ToolTip class, it is well documented, and MSDN
includes an example. And CodeProject has several articles about it.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
I have problem retrieving the primary key for a new row that is added to the database.
This is what I have now:
DataTable^ MyTable = myDataSet->Tables[0];
DataRow^ row = MyTable->Rows->Add();
if (row != nullptr)
{
row["item_id"] = item_id;
row["use"] = use;
row["type"] = Convert::ToInt16(type);
DataAdapter->Update(myDataSet, "tblPanel");
PanelID = Convert::ToInt64(row["ID"]);
}
now the value PanelID is always 0 for the first time this loop runs, the second time and further the information is correct and I can use the PanelID to create the relation with other tables.
What am I missing?
Stefan
|
|
|
|
|
From my experience, the primary is usually created at the database server via a trigger or stored procedure. You can send your data to be added to a store procedure which can return newly created primary key.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I have been looking at different site and manuals for an example but have not found one containing a stored procedure. Mostly I found some SQL way to find it but it has the same problem. Strange thing is that only the first time is not working and I can't find any missing declarations.
Stefan
|
|
|
|
|
I am at work right now and cannot provide an example of how I solved the problem. I have used both Oracle and Sql Server store procedures to obtain the primary key. However, I believe there are some tricky spots.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
led mike's post refers to what I am talking about. I also have a different solution that uses a stored procedure but it was designed to do some extra fancy stuff that may be overkill for what you have in mind.
Geo
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
|
I checked out the site and found the things I need I think.
Just pity that microsoft provides only examples in VB and C#.
Stefan
|
|
|
|
|
Stefan Baens wrote: I checked out the site and found the things I need
I'm glad you have a solution
|
|
|
|
|
I'm currently using VisualStudio2003 (and cannot change due to the fact that other team members are using it too).
My current project uses managed code to dynamically link a .NET-DLL into my program, works so far.
The only problem is, that to compile and link this DLL I need a [dllname].netmodule file, which can only be generated with VisualStudio2005.
The file is generated by linking the dll into my project (references) and automatically used when the dll is loaded.
VC2003 does not generate this file automatically, but if it is not present, the DLL cannot be used (access violation).
Using google I found this to be a bug in VC2003 but no appropriate solution.
Is there any way to generate this file with VC2003 (compiler switch, etc.) automatically??
Thx in advance
|
|
|
|
|
Hi,
AFAIK it's currently only supported to compile a netmodule in VS2005 via command line. Currently there is no IDE support for it. Because this really bugged me I looked for another way and ended up changing a single tag in the csproj-file.
Before change:
<OutputType>Library</OutputType>
After change:
<OutputType>module</OutputType> Works perfectly for me (VS2005) but you've to check if this works in VS2003, too.
After you've done this change take care not to change the output type of this project via the IDE anymore. It will of course overwrite your hand-changed tag.
Perhaps the following links can help you, too:
http://support.microsoft.com/?scid=kb%3Ben-us%3B309805&x=9&y=11[^]
http://support.microsoft.com/kb/311416/EN-US/[^]
cheers,
mykel
OMM: "Let us be thankful we have an occupation to fill. Work hard, increase production, prevent accidents and be happy."
|
|
|
|
|
Well, thank you for your answer but that didn't help..
I'm using VC2003 and a .vcproj file to create the dll.
The .NET library is linked inside(!) this dll as I want to use some of the implemented functions.
The .NET library is linked via assembly reference only:
AssemblyReference RelativePath="$(SolutionDir)\include\[.NET].dll"
I can access the namespace and library classes at design time.
The weired thing is that VC2005 created the [.NET].netmodule automatically (with the same project), but VC2003 does not.
Looks like there is no (easy) solution for this bug and I have to use VC2005 to create the module file..
thx
-- modified at 6:16 Tuesday 28th August, 2007
|
|
|
|
|
Hello,
Is there an easy and fast way to convert an vector to a managed array?
Best regards
Hansjörg
|
|
|
|
|
hansipet wrote: Is there an easy and fast way
Yes, all you have to do is write some code, compile and then execute.
|
|
|
|
|
I think everyone knows that code can be written, compiled and execute. But not every code is the best and fastest solution for a given a problem.
I think it would be better when you don't give such stupid hints!
|
|
|
|
|
He is telling you that you need to determine the "best and fastest" solution on your own because each solution has trade-offs that affect certain situations negatively. Since you know your situation and we don't, you will get stupid hints! So, get your compiler and profiler, and have fun!
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hi,
I came to know that the default funcations created when we creat a class are
1) Constructor
2) Distructor
3) Default copy constructor
4) Default assignment operator overloaded
5) ...i dont know what is 5ht one
can any one correct for the above funcations.
And also I dont know what is the use of these funcations. For our need we need to create our own copy constructor ..then what is the use of default (in built) copy costructor. Also please breaf what is the use of these inbuilt (default) funcations.
Nandu.
|
|
|
|
|
I believe your question is directed toward C++ and not C++/CLI. You are in the wrong forum. Nevertheless, you need to purchase a good C++ Primer or you can go to this web site: http://www.parashift.com/c++-faq-lite/[^]
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hello
I want to use a vector class
Is there a exemple how to use this
thanks,
aef
|
|
|
|
|
|
Hello,
I would like to know how to use and declare a buffer in the visual c++/cli
because I made a capture TCP/IP (sniffing) but my application was being length (in a networks with very high speed like 100Mbit/s),
to regulate this problem a beffer should be used.
aef
|
|
|
|
|
I need to communicate with a non-windows platform via TCP. The message will be a unmanaged data structure. How can I encode this into a managed type that the Socket.Send command can handle? The message must be decoded on the other platform, which won't have the .NET framework.
|
|
|
|
|
You'd need to create an array of Bytes (for the Socket::Send()) and "serialize" a managed type
into a stream of bytes (representing the structure) in the array.
A couple things to keep in mind:
Structure packing can be different on different languages/platforms. This means you have to
ensure each of the structure's members is at the appropriate offset in the Byte array.
The BitConverter class can help for converting managed base types to a stream of byes,
but you need to deal with byte order (endian-ness) of multi-byte types if the other
platform is different. If this is an issue, multi-byte integer types sould be sent using
network byte order. IPAddress::HostToNetworkOrder() and IPAddress::NetworkToHostOrder()
can do the conversion but the other end needs to know to convert the sent network-order
bytes back to host-order.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|