|
Hi,
I have to get handle for a process.I am doing as below.
Process^ pc = Process::Start("AcroRd32.exe", strCmdArgs);
IntPtr ProcHandle = pc->Handle;
HWND hwndProc = (HWND)ProcHandle.GetHashCode();
HMENU hMenu = ::GetMenu((HWND)&hwndProc);
// When I debug Iam getting Undefined Value in hMenu.
Is my code correct? Any suggestions would be helpful.
Thanks
Today is a gift, that's why it is called the present.
|
|
|
|
|
narayanagvs wrote: Is my code correct?
Just guessing... HWND hwndProc = (HWND)ProcHandle.GetHashCode();
That doesn't seem right to me, I don't remember ever using GetHashCode to obtain a HWND.
|
|
|
|
|
First, I know there is a known bug related to this warning message, and I know I have to call Microsoft to get the hotfix. My project is written in C++/CLI, with reference to 3 small C# DLLs. I've been working with the project for 6 months with NO warning messages. As soon as I installed VS 2008 Beta 2, BOOM! 350 warning messages, all C4945.
I am positive VS2008 is at fault, because on my other machine, which has ONLY VS2005, the project still builds with no errors.
Has anyone else ever encountered the same problem once VS2008 is installed? Does anyone know if uninstalling VS2008 will roll things back effectively enough to alleviate my problems? I'm just not excited about having to sit on hold with MS support for half an hour to get a hotfix because they're too darn stubborn to just post a !%@#($*&!@#($ download link.
|
|
|
|
|
If you can put together a small project that demonstrates/reproduces this as a legitimate
VS 2008 bug, I can forward it to MS for you. If it's a bug, this should be simple -
you know the symbols involved.
This issue is currently NOT reported for the VS 2008 Release Candidate, so if it's still
an issue, we should get it in there!
Also check and make sure you don't have a genuine namespace/symbol-name collision
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark,
I appreciate the offer, but it sounds like I didn't clearly express my problem and suspicions.
I am not claiming to have found a VS2008 bug. My idea is that the VS2008 INSTALLER somehow blows up my installed VS2005. The build problems occur in VS2005 -- the environment my project was created in. I have not tried porting the code over to VS2008.
There are 2 reasons I'm blaming the VS2008 installer: (1.) my project built fine before I installed 2008, (2.) on my other machine, where I have NOT installed 2008, the project continues to build fine without the aid of a hotfix (as addressed in KB922271). This seems to rule out any coding or project configuration problems.
|
|
|
|
|
Ohhh, ok. Sorry for the confusion.
I'm not sure what's up with a side-by-side install of 2008 B2 with 2005.
I never installed the B2 version.
What does the readme say about installing with 2005?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello,
I am using Visual studio 2008, but still i have the following error.
Warning 1 warning C4945: cannot import symbol from '.\X.dll': as 'X module' has already been imported from another assembly 'Y' .\Y.dll .
I am using C++ dll in the .NET project.
Please do the needful.
Thanks and Reagrds,
Savitha
|
|
|
|
|
I need to be able to track a mouse's mmovement within a dialog that has several (10) EditBoxes. Since it would not be practical for the User to have to tab several EditBoxes to get to the one he/she wants to enter data into; the EditBoxes are not Tabed. I need to know where the User is (in what EditBox) so that the proper function call is active for the users input. This is actually a Wizard-style property page so there is no OK button to poll for; and the User is not required to use any of the EditBoxes on any given page. Hence the need to know when ther User has Started entering data in what EditBox.
Help with usable code examples would be appreciated. (Note: I am using VS 6.0 in MFC.)
A C++ programming language novice, but striving to learn
|
|
|
|
|
|
I am creating a function two string as input and return the concatenated of the string. How can i write these code. I tried but my program crashes
can any one reply for this
karthickbabu
|
|
|
|
|
String ^Str1 = "Concatenated";
String ^Str2 = "String";
String ^ConcatenatedStr = String::Concat(Str1, Str2);
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I'm guessng you;re in the wrong forum. However, either way, if you tried something, post the code so we can correct it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Anyone want to make $25-30/hr tutoring me via phone? I just installed Visual Studio 2008 Beta 2 and I am looking for someone to help me come up to speed on C++, C# and VB. I haven't touched Visual Studio since 6.0, so I am a bit out of date. Also, I'm entirely self-taught, so I would like someone who can show me how to start from scratch and set things up 'correctly'. My focus is on creating a simple C++ form app using CLR specifically for Vista. I need to know the correct method for reading/writing files, and I would like to learn how to use RegisterPowerSettingNotification to catch the WM_POWERBROADCAST message in C++, C# and VB. If you can control a serial port, that would be great too.
Currently I am creating an application to control my home projector, but this is really just to help me come up to speed again. This can be done in off-hours late nights and weekends and I can pay via paypal.
My email address is ima_computer@yahoo.com
Thanks!
- Ed
|
|
|
|
|
Asking questions on this site is a good way to get some questions answered...
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
|
|
|
|
|
I have to use the serial COM-Port with managed C++, but I can not find any project.
On CodeProject I found the articel "How to open a serial COM port in Managed C++", but I allways get a exception.
So, please, has somebody a managed C++ project with COM?
|
|
|
|
|
I have no experience with this subject, but if I need to solve your problem I would look for samples/examples in C#. It is simple enough to translate C# code samples of the BCL usage into C++/CLI.
|
|
|
|
|
Ontanggabe Parulian wrote: Is there anyone know how to get the length of the "ld_pbyteTemp" in function printLen?
Not intrinsically. What is your background? This is a C 101 topic. C arrays have no length data in their structure, period.
Also this is the wrong forum for a pure C/C++ question. See the message at the top of the forum "The C++ / CLI is for managed and mixed-mode C++ programming only", open it up and read it, it won't hurt you.
|
|
|
|
|
Hi,
I have a BYTE pointer it contains the values that i have read from a jpeg file. how can i convert it in to a BYTE pointer of grayscale image.
Thanks in advance
|
|
|
|
|
Well, I assume you're askng in te wrong forum, but if you aren't, then the Bitmap class is how you convert a JPEG to an in memory image, and you can convert to greyscale with a color matrix. You can then save the resultant image as a stream, giving you a JPEG byte array again.
But, if you're n the wrong forum, you need to find another way to read a JPEG, convert it to grey scale and save it as a JPEG again.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
using C++, please help to create display the first screen page for the project?
great things comes in small packages
|
|
|
|
|
|
Hi guys.. wanna ask abt a question on c programming.. no c++ or c# but didnt find the right place to post this.. so here goes..
Currently doing a project on c,
aim is to retrived certain field from a .txt file..
my question is do i need to create a structure for that txt file..
if not.. how do i skip a field when readin from a .txt file.??
etc of what in the .txt file
[clientA] [id] [password]
[clientB] [id] [password]
i wanna retrieve the id and password only..
so far i only wanna to opent eh file and print all the info out..
can i use fscanf to do it.
tks guys
|
|
|
|
|
Hi,
first of all C question belong in the "Visual C++/MFC" forum; current forum is for managed
C++ code, which means running .NET Framework and base classes.
if your input file holds one record per line, you can read a line, parse it (maybe just throw
out what you don't need), and print it. There probably is no need to store it in a data
structure at all.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
The problem I am having seems to be a C++/CLI forms designer issue. If I duplicate my steps below as a C# project, everything is fine. If I keep it as a C++/CLI project and actually run the application, everything is fine...
I'm trying to create a parent form class "FParent" so that I don't have to keep recreating controls common to each of the child forms. The child controls need to be contained in a Panel control, which I would also prefer to set in the parent form so that I don't have to keep re-creating the container panel.
When I create the child form "FChild", I go into the code view and change the class declaration from "public ref class FChild : public System::Windows::Forms::Form" to "public ref class FChild : public FParent".
At first, I could not drag a control into the parent panel area. However, if I go into the parent code and make "panel1" PROTECTED instead of PRIVATE, now it lets me drag a control.
So then I tried to drag a button onto the panel, and in FChild code I could see the line: "panel1->Controls->Add(button1)". This is exactly what I want. HOWEVER, when I close the designers, rebuild the project, and reopen the designers, the child button no longer renders properly. Instead of rendering as a child of the panel, the control is relative to the FChild client. In other words, if I had dropped a button at Point (3, 3) into the panel which was located at Point(20, 20), the button gets rendered at client point (3, 3) instead of the desired Point(23, 23). To make things worse, if the parent panel overlaps the child control, the parent panel is rendered over the top of the child control.
In other words, I have to design the child form in one sitting and pray that I never have to revisit it, because the only way to change the layout of the child form controls is to delete the form and start over since the parent panel covers over the child controls.
Does anyone know how to get around this and make the control render as a child of the parent panel, or do I need to compromise and make the container panel a member of FChild instead of FParent?
Thanks for your help.
-- modified at 15:43 Tuesday 30th October, 2007
|
|
|
|
|
class a
{
public void getdata()
{
}
}
class b
{
public void getdata()
{
}
}
main()
{
a aa;
b bb;
bb *ptr;
ptr = &bb;
ptr = &aa;
ptr->getdata();//class a getdata function
}
i was trying to call the functio of class a though the object of class b.
the above syntax is right?
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|