|
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
|
|
|
|
|
Sonia Gupta wrote: i was trying to call the functio of class a though the object of class b.
the above syntax is right?
No.
It shouldn't even compile.
You cannnot do this:
bb *ptr;
bb is not a type, it's a variable of a type. You can declare and initialize a
b pointer, however:
b *ptr;
ptr = &bb;
There is no association between your a class and your b class so
you cannot assign the address of an a object to a pointer to a b object.
This will NOT work:
a aa;
b bb;
b *ptr;
ptr = &bb;
ptr = &aa; <-- Wrong! Won't compile!
Please post your Non-managed C++ questions on the correct board!
(that would be the Visual C++/MFC Board[^])
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
sir,
please help me out of the problem ... suggesst me the coding to read png image
Attached is the image on which the processing is to be performed
Take this image. It is in .png format.
It has 52 characters written in it.(26 samll a b c d ………z) and 26 capital letters (A B C ………Z)
From this big image we have to segment the image into 52 small images each representing a single character.
Now we have 52 small images. Each of them represents a character.
After this on every image gabor filter is to be applied. Gabor filter is an orientation selective filter. It has some parameters by changing them we can have a set of gabor filters with different parameters.
On each character image 16 gabor filters are to be applied. This way we will have 16 output images for each image.
For all the sixteen images centroid of each image is to be found out. This will have x, y coordinates . find the normalized area of each image. Now every character has 48 components to define it (16 filter images giving 2 coordinates each and area of each output image give 16x2 +16). This can be represented in vector form.
We now have 52 vectors one vector for each image.
To test : given any 48 dimensional vector find the distance of this vector with all 52 vectors. The vector for which difference between given vector and our set of 542 vectors is least wiil be the answer. This means the given vector represents the character “ a” if suppose the difference between given vector and vector for character “a” is found to be the least.
|
|
|
|
|
If you're using C, you're in the wrong forum. There is no such thing as C for .NET, because C is not OO.
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 )
|
|
|
|
|
hey..
i am using C++ (wxWindows for GUI)--I have an image file in RAW format ...i have read the file into a 2-D array, how that data is to be used display the image on a control?
thanks
|
|
|
|
|
If wxWindows is not a ref (managed) class then you're posting on the wrong board -
you should post on the Visuall C++/MFC board instead.
If this is managed code, you may want to look into the System::Drawing namespace,
Bitmap class for converting your pixel data to a bitmap for drawing.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
hey,
thanks Mark for the reply.. hopefully the idea you gave will solve my problem
|
|
|
|
|
Hello, I’m triying to load and execute managed code using methos as shown belong
<br />
SAFEARRAY * psArr;
SAFEARRAY * Param;<br />
CComPtr <ICorRuntimeHost> spRuntimeHost;<br />
CComPtr <_AppDomain> spAppDomain;<br />
CComPtr <IUnknown> spUnk;<br />
CComPtr <_MethodInfo> MI;<br />
CorBindToRuntimeEx( NULL, L"wks", STARTUP_LOADER_OPTIMIZATION_SINGLE_DOMAIN,<br />
CLSID_CorRuntimeHost ,<br />
IID_ICorRuntimeHost ,<br />
(void**)&spRuntimeHost);<br />
spRuntimeHost->Start();<br />
spRuntimeHost->CurrentDomain (&spUnk);<br />
spUnk->QueryInterface(&spAppDomain.p);<br />
try<br />
{<br />
MI = spAppDomain->Load_3(psArr)->GetEntryPoint();<br />
Param = MI->GetParameters();<br />
MI->Invoke_3 (NULL, Param);<br />
}<br />
catch (_com_error ex)<br />
{<br />
std::wcout<< ex.ErrorMessage();<br />
}<br />
SafeArrayDestroy(psArr);<br />
So if I invoke GUI application all good, but if I invoke Console application Invoke_3() function rise an exceptional situation…
Who has any ideas how to run Console Application?
|
|
|
|
|
Please don't post your question in multiple forums.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hi there.
I've been experiencing a problem with named pipes server (single
threaded server using i/o overlapped reading/writing). The code
examples of a client and server may be found in Codegear RAd
studio 2007 ("named pipe client" and "named pipes single thread
using overlapped i/o"). The only thing i changed was implementing
a reading handler wich was supposed to store received data into
the Tlist object.
The problem is that if i dont receive data from client outright
after connect i get an ERROR_IO_PENDING pseude error while executing ReadFile function. Subsequently, after having received
that error just once i'm unable to read the info from the pipe
unless to drop the client and try the same again (which results
with the same error).
Have no idea about whether was it planned by example writers to handle this kind of a trouble but nothing seems to be working properly to receive the data which followed that error.
So i'm interested are there any workarounds for that? I mean when i execute ReadFile and it returs ERROR_IO_PENDING error.
In my opinion the most common "reading pipe scenario" would be:
0)Connect to the client
1)Perform ReadFile on the connected pipe;
2)if it returns ERROR_IO_PENDING - wait for the pipe to finish the pending operation (read in this case) by using GetOverlappedResult function (as it implemented in example).
3) perform readfile function again.
The problem is that it can never read the data from the pipe later on even after all the info has been received (GetOverlappedResult returns correct bytes transferred).
As far as it goes i'm deeply stuck into that without seeing any light in the end of the tonnel.
Thanks in advance
Any help would be appreciated.
Andrew.
P.S. code examples located in CodeGear RAD Studion 2007 ("Using Pipes") ms-help://borland.bds5/Ipc/base/using_pipes.htm
-- modified at 7:06 Monday 29th October, 2007
|
|
|
|
|
solved
|
|
|
|
|
There are some errors.
error C2039: 'btowc' : is not a member of '`global namespace'' in cwchar.h
I see some information about gloabal namespace, but i dont understand why
it comes some errors.
Is it because cwchar.h file is obsolete?
If it is, what can I do if I need to use the file?
Can somebody help me to solve the problem?
Thx for ur reply.
Jane.
|
|
|
|