|
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.
|
|
|
|
|
The header file "cwchar.h" puts btowc into the std namespace:
namesapce std {
using ::btowc;
...
}
Thus, you will have to prefix btowc with std , std::btowc , or place this in your code:
using std::btowc
or this:
using namespace std;
before using btowc .
In the future, please ask C++ related questions in the Visual C++ / MFC forum.
-- modified at 14:38 Tuesday 30th October, 2007
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
|
My Requirement is to create a web application in which a TAB Control is placed in it.
In each tab same controls are to be placed. for this i created a webuser control and accessed the same in each tab.
I have placed some controls like radiobutton list, textboxes, dropdowns fro selection criteria in the web user control.
I have created a class and wrote some properties , serialize and deserialize methods to store the values selected from each tab and save to a disk file.
The question is that in one tab whatever i have selected and saved to the file it is coming in all tabs. I dont want this to happen.
it must come in one tab only, as i want to save different selection for different tabs.
So How can i do this?
Please help me out if u have any solutions by which this prob can be solved.
chandra
|
|
|
|
|
This can be better answered in the ASP.NET forum.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
i nedd boyer-moore alogritim for seraching hex values source code in c++ if any body have please share.
|
|
|
|
|
"Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with." --Maunder
Also, this is not the C++ forum.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hi I have a requirement like i have to place a scrollbar for the treeview control in order not to increase the height of the page/control.
i have set the property of treeview control(ImageSet="Arrows").
childnodes are nearly 200.so whenever i click that image control is expanding and the page size is increasing.
Instead of that can i place a scroll bar so that the control can extend upto some level in order to avoid the page size getting increased.
So i request u to solve this problem if u have any solution.
chandra
|
|
|
|
|
I want to compile a program.I compile the files with /TP.
I originally use /CLR option, but it says that a .c file cant work with /clr.
I see the page.
http://msdn2.microsoft.com/en-us/library/ms173265(VS.80).aspx
so, I change it to no /CLR. Then it comes out other problems.
1. syntax error '__value'
2. error C4980: '__value' : use of this keyword requires /clr:oldSyntax command line option
But I change it to /clr:oldSyntax,
I comes the error that error D8045 : cannot compile C file '.\gsm\RPE.C' with the /clr option again.
How can I debug this error?
Appreciate for ur reply.
Jane
-- modified at 3:01 Monday 29th October, 2007
|
|
|
|
|
Hello All,
Is there a (free) GUI builder out there for C++ that doesn't used the .NET framework? I
want to learn that basics of GUIs with C++ but i can't find anything other than .NET related
information.
Is it even possible to write non-platform specific GUI programs?
Thanks
|
|
|
|
|
Ylno wrote: Is there a (free) GUI builder out there for C++ that doesn't used the .NET framework?
Then it is not a great idea to ask this in the Managed C++ forum.
Try the unmanaged C++ forum instead.
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
|
|
|
|
|
Hi Luc,
I seem to always get this wrong. What's the difference? I don't understand the difference between the different types?
I've just been learning C++ with a text editor and a command line compiler so does that mean i'm using managed or unmanaged?
Does managed mean that you're using stuff from the .NET framework or a similar framework.
Thanks anyway for pointing me in the right direction
|
|
|
|
|
Hi,
yeah, the forum structure (and their names) may confuse you:
the regular C++ language, the only C++ Visual Studio supported up to version 6,
and still supported by newer VS versions, is handled in the "Visual C++/MFC" forum.
This seems the one you need this time.
the extended C++ language that runs on top of the .NET Framework and uses all the
nice .NET classes, is handled in this, the "(Managed) C++/CLI", forum. It requires
Visual Studio 7 or better.
C# is always managed, and has its own forum.
old VB and new VB.NET are both handled in the one "Visual Basic/VB.NET" forum.
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
|
|
|
|
|
|
Either the user running your application needs to be given permission on the shared folder, or you would have to impersonate a user who does have permission. This[^] article describes impersonation in C++.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Hi, I'm using Visual Studio 2005 C++/CLI. I have a double value of 4.000000000000000 that I subtract 0.2 from leaving 3.7999999999999998. I want to round this to 3.8 so I use 'double rounded_value = System::Math::Round(value_to_round, 2)' where the resulting value is exacly the same at 3.7999999999999998. In the next iteration I subtract 0.2 from the rounded value of 3.7999999999999998 leaving 3.5999999999999996. Then the Round() function results in 3.6000000000000001. After subtracting 0.2 from this I get 3.3999999999999995 and the Round() function results in 3.3999999999999999. If I use the Round() function to round to an integer it works fine, but this rounding to 2 significant digits is not working. Anyone know why?
Thanks
Buck
|
|
|
|
|
According to Microsoft's documentation:
Return Value:
The number nearest value with a precision equal to digits. If value is halfway between two numbers, one of which is even and the other odd, then the even number is returned. If the precision of value is less than digits, then value is returned unchanged.
Also:
The digits parameter specifies the number of significant digits in the return value and ranges from 0 to 15. If digits is zero, then a integer is returned.
The maximum total number of integral and fractional digits that can be returned is 15. If the rounded value contains more than 15 digits, the 15 most significant digits are returned. If the rounded value contains 15 or fewer digits, the integral digits and as many fractional digits as the digits parameter specifies are returned.
The behavior of this method follows IEEE Standard 754, section 4. This kind of rounding is sometimes called rounding to nearest, or banker's rounding.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
I went ahead and used a Decimal type to get around this, but I thought the number of significant digits was the number of digits to the right of the decimal point... 1.0 is one significant digit, 1.00 is two significant digits 1.000 is three significant digits and so on. But it doesn't matter what you use for the digits parameter. A digits parameter of 0 does return an integer but a digits parameter of 1 to 15 always returns fifteen significant digits.
|
|
|
|