|
HI Friends,
Will anyone please tell me how i can use my C++ modules/Interfaces in .Net.
I want to use them in C#.
Thanks,
Sumit
Sumit
|
|
|
|
|
what exactly do you mean by c++ modules? if you mean dll, you will have to use P/Invoke (import functions through DllImport attribute). if you mean COM libraries, you just have to add a reference to it, VisualStudio will use tlbimp.exe to create an RCW[^]
|
|
|
|
|
Sumit Kumar Khatri wrote: I want to use them in C#.
COM/ATL is Key to success there buddy
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I have some questions about userland hooks and this article Process-wide API spying - an ultimate hack by Anton Bassov.
QUESTION 1:
why "ProxyProlog" + "Prolog"? Why not just "Prolog" - ie. eliminate "ProxyProlog" and jump directly to "Prolog" intead?
QUESTION 2: The following code in DllMain of the injected Dll? Is there any place where we can download the source?
<br />
IMAGE_DOS_HEADER * <br />
dosheader=(IMAGE_DOS_HEADER *)hMod;<br />
<br />
IMAGE_OPTIONAL_HEADER * opthdr =<br />
(IMAGE_OPTIONAL_HEADER *) ((BYTE*)hMod+dosheader->e_lfanew+24);<br />
<br />
IMAGE_IMPORT_DESCRIPTOR <br />
*descriptor=<br />
(IMAGE_IMPORT_DESCRIPTOR *)(BYTE*) hMod +<br />
opthdr->DataDirectory[ IMAGE_DIRECTORY_ENTRY_IMPORT]. <br />
VirtualAddress;<br />
<br />
while(descriptor ->FirstThunk)<br />
{<br />
char*dllname=(char*)((BYTE*)hMod+ descriptor ->Name);<br />
<br />
IMAGE_THUNK_DATA* thunk=( IMAGE_THUNK_DATA*)((BYTE*) hMod +<br />
descriptor ->OriginalFirstThunk);<br />
<br />
int x=0;<br />
while(thunk->u1.Function)<br />
{<br />
char*functionname=(char*)((BYTE*) hMod +<br />
( DWORD)thunk->u1.AddressOfData+2);<br />
<br />
DWORD *IATentryaddress=( DWORD *)((BYTE*) hMod +<br />
descriptor->FirstThunk)+x;<br />
x++; thunk++;<br />
}<br />
<br />
descriptor++;<br />
}<br />
<br />
struct RelocatedFunction{DWORD proxyptr;<br />
DWORD funtioncptr;char *dllname;char *functionname;};<br />
<br />
BYTE* ptr=(BYTE*)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,32);<br />
RelocatedFunction * reloc=(RelocatedFunction*)&ptr[6];<br />
DWORD addr=(DWORD)&ProxyProlog;<br />
reloc->proxyptr=addr;<br />
reloc->funcname= functionname;<br />
reloc->dllname=dllname;<br />
memmove (&reloc->functionptr, IATentryaddress,4);<br />
ptr[0]= 0xFF; ptr[1]= 0x15; memmove(&ptr[2],&reloc,4);<br />
DWORD byteswritten;<br />
WriteProcessMemory(GetCurrentProcess(),IATentryaddress,&ptr,4,&byteswritten);<br />
QUESTION 3:
What header do we need to include?
Thanks in advance. Thanks!
-- modified at 3:35 Tuesday 3rd January, 2006
|
|
|
|
|
You can ask the question to the author himself.
You can find this place just below the article you are talking about, ie the end of the article.
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Owner drawn wrote: You can ask the question to the author himself.
You can find this place just below the article you are talking about, ie the end of the article
yeah well. I did. No one is answering.
|
|
|
|
|
I create a application Of MFC AppWizard(exe),its type is "Dialog Based".There is no error in compiling.But it present a assert bug when execute programme:
File: dlgdata.cpp
Line: 624
What happens in my application? Anyone who can help me.
|
|
|
|
|
Try to stack trace in debug mode and find out from where did it originate or from which function in your app did it start. It will help you and us.
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
-- modified at 3:12 Tuesday 3rd January, 2006
|
|
|
|
|
It seems that you are trying to call some data exchange function while control is not yet created (e.g. you can't do that for a control in dialogs constructor, because control is not yet created). could it be that you are calling UpdateData(TRUE) in dialogs constructor? if so, try to move that code to WM_INITDIALOG handler (OnInitDialog). however, this is just a wild guess without your code.
|
|
|
|
|
|
I want to implement a PDF Image file as multipage where each page consists of one image.Can you send the source code for the above.
Thanks & Regards
Ramnath
Ramnath Panda
|
|
|
|
|
I think you will need to save your image files as TIFF files first, then they will be easy to concatenate, and then convert to PDF . LibTiff does that. Search for LibTiff and download it. It has various tools to concatenate tiffs , convert to pdf etc.
You did not mention to convert what format files to PDF . If they are tiff files, then half the work is done. If they are another format, then you could use CxImage (search for it on this site) to convert them to tiff first, then use LibTiff on them.
this is this.
|
|
|
|
|
hi all,
i want to split the MainFrame wnd of MDI app.i am able to split the CChilkdframe but CmainFrame in mDI app i am not..
i tried using OnCreateClient in Mainfrme.cpp but its giving assertion errors.
can anyone help me its very urgent..
thanks
Gets
|
|
|
|
|
I don't think you can do that. You can only split MDI child windows not MDI parent window.
Hope I got your question right.
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Yup,
you gotmy question...
i wanted it to look something like Query Analyser of Sql Server..
means exploreer on left view and a document on the right side
can u throw some light on this
thanks
Geeta
|
|
|
|
|
Why do you need an MDI for this.
Just a simple frame inherited from CFrameWnd.
Split it up and assign it different views in different panes.
You can have nested panes.
Take a look at IdFromRowCol function.
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
u mean to say hve simple SDI app and split it up
and then assign diff views to it ..
ok i tried that..
how to kep the right pane empty.. i mean it should hve anything..especially that white colour background
thanks
Geta
|
|
|
|
|
geeta_patil wrote: how to kep the right pane empty
Just have an emtpy view.
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
hey i'm noticing it now only. you have slimmed down like me!![b] now we both look similar with our color,weight and marquee!! cheers
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--
|
|
|
|
|
T-1000 wrote: you have slimmed down like me
Yeap. You've got it buddy.
This one's cool.
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
Ive seen lots of examples of completely rewritten tab controls, but has anyone done what should be a relatively simple override of CTabCtrl::DrawItem and called the XP theme functions? I just want an XP looking tab control where I can change the text color of certain tabs, but cant get the drawing to look right
|
|
|
|
|
An option is...
HiglightItem(nTabNumber, TRUE); //To Turn on highlighting
HighlightItem(nTabNumber, FALSE); //To Turn off highlighting
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
HI,
There are two classes A and B as follows
class A
{
public:
update_host(CString hostname);
}
class B
{
public:
get_hostname();
}
The get_hostname() gets the hosts name and then calls update_host as folows
A aobject;
aobject.update_host(CString hostname);
now this is what i do in update_host(CString hostname)
update_host(CString hostname)
{
m_hostname=hostname;
UpdateData(FALSE) //to update the value in the edit box.
}
now,when i execute it,i get the error saying
Debug assertion failed.
file:wincore.cpp
line:3095.
Please help in this regards.
Thank you.
HEllo
|
|
|
|
|
harshandu wrote: UpdateData(FALSE) //to update the value in the edit box.
I am taking assumption that Class A is CDialog Drived Class, have you checked, that Dialog Box is Visible State at the time UpdateData() is called?
As if the dialog Box is not created before call of UpdateData, the dialog box application likly to crash.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Does Win32 console based application supports WinMain and WinProc
phani
-- modified at 1:27 Tuesday 3rd January, 2006
|
|
|
|