|
Nish,
Please understand, I AM of the opinion to keep native code just that - native. My wrapper being a mixed mode design straddles both. That is why I place the native struct with manged object. Isn't your post of putting the native struct with managed member in native code outside of that perspective? There is really no peculiarity of design. The native function works fine when a NULL is passed to pContext. The native callback writes to stdout in a native console app. It is the wrapping of the native function that required an additional arg be added so the use of a background worker can be used.
Thanks very much for all the invaluable help. I wished more was covered on this topic in your book.
|
|
|
|
|
alleyes wrote: I wished more was covered on this topic in your book.
Well, hindsight is always 20-20
|
|
|
|
|
is this the fastest way to access the RGB values of a pixel of a bitmap file in c#?
the code is below
bm is previously declared Bitmap object.
Collapse
BitmapData bmd=bm.LockBits(new Rectangle(0, 0, 10, 10), System.Drawing.Imaging.ImageLockMode.ReadOnly, bm.PixelFormat);
int PixelSize=4;
for(int y=0; y<bmd.Height; y++)
{
byte* row=(byte *)bmd.Scan0+(y*bmd.Stride);
for(int x=0; x<bmd.Width; x++)
{
row[x*PixelSize]=255;
}
}
OR is there more faster way exists to access the RGB values of a pixel in C# or in VC++?
if in VC++ we can access the RGB values more faster than this so please help me.
and if the above method is the fastest way and no other faster method exists than this in c# or in VC++ so please comment as well.
thanks
|
|
|
|
|
|
|
i am sorry actually i am new to the codeproject. but now i got how to ask a question.
thanks a lot
|
|
|
|
|
inayathussaintoori wrote: i am sorry actually i am new to the codeproject. but now i got how to ask a question.
thanks a lot
No problem, we all need to start somewhere
|
|
|
|
|
Hi,
Please tell me how can i replace the default list box of a combo box with a custom made one. I have made a subclassed listbox. I want to show this listbox when user clicks on the down arrow of combo box.
Thanks in advance,
John.
|
|
|
|
|
|
Hello
I want to program a phone book using two dimension pointers. Please help me with a simple example of string two dimensional pointer.
Thanks in advance
|
|
|
|
|
|
My problem is How to start interrupted detection process again.
thanks in advance
|
|
|
|
|
What is an "interrupted detection process"?
|
|
|
|
|
|
This is the C++/CLI forum meant for managed and mixed-mode topics.
Your thread should ideally have been here:
http://www.codeproject.com/Forums/1647/C-Cplusplus-MFC.aspx[^]
That said, if you look at his code, specially the GetSession and DownloadFile methods, you'll see that he downloads the file using InternetOpenUrl and InternetReadFile .
|
|
|
|
|
sorry, I'll just move my question then. thanks for the guide.
|
|
|
|
|
I am working from a book that has me make a simple Paint program on an MFC SDI. It uses a metafile to store the GDI. I can save the metafile to disk, open the metafile from disk, but the book does not show me how to print the metafile to a printer. If I try to preview or print the document, I get a blank document.
I am saving the metafile this way...
void CPainterView::OnFileSave()
{
CPainterDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
HMETAFILE MetaFileHandle = pDoc->pMetaFileDC->Close();
CopyMetaFile(MetaFileHandle, "painter.wmf");
CMetaFileDC* ReplacementMetaFile = new CMetaFileDC();
ReplacementMetaFile->Create();
ReplacementMetaFile->PlayMetaFile(MetaFileHandle);
DeleteMetaFile(MetaFileHandle);
delete pDoc->pMetaFileDC;
pDoc->pMetaFileDC = ReplacementMetaFile;
}
I showed you how the book saves the metafile because I have a feeling printing will be very similar.
With the MFC SDI, I have the print features...
BOOL CPainterView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CPainterView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CPainterView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
Can I use any of these print features to print my metafile? Thank you
modified on Thursday, October 21, 2010 1:36 AM
|
|
|
|
|
|
Hi,
I am using Visual studio 2005 to build a small Win32 .exe. This exe is doing a very small registry operation only. So i do not want a UI for this. I tried to do a win 32 console application. but while launching that the command console pops up for a moment till the execution completes.
How to build the exe where the console will not pop up?
Thanks in advance.
Birajendu
SonicWALL
Bangalore
India
|
|
|
|
|
I am not sure how you can do that, if it's a console application then it needs to execute in a console Window.
By the way this is not a Managed C++/CLI question; please use the correct forum for your queries.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Richard MacCutchan wrote: By the way this is not a Managed C++/CLI question; please use the correct forum for your queries.
Thank you, take a 5!
|
|
|
|
|
Thanks, I do think this has been getting worse recently, which is quite worrying when you consider what the levels of ability, initiative, etc. of people on these forums should be.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
birajendu wrote: How to build the exe where the console will not pop up?
Just choose a normal Win32 project (not a console project) and just don't put any code that creates a window.
|
|
|
|
|
Hi,
I would like to write a utility which will clear all those registry entries which has a particular sub string (e.g "mycompany").
So to achieve this I think i need to implement some logic which will check all those registry paths having keys which contain string/sub string "mycompany". I am trying to find out is there any API like FindNextFile() or some thing like that for registry keys.
Thanks in advance.
Birajendu
SonicWALL
Bangalore
India
|
|
|
|
|
birajendu wrote: is there any API
Yes, it's all here[^] in MSDN; something you should familiarise yourself with.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|