|
Hi,
how to use external function in a dll from c
For Example:I have one function(say random value generation) in C.
So the same function i want to use for my another C project using that dll.
How can i call old project function from currect project using dll.
I tried "#pragma dll(MyFile)"...
Wat i did is copy paste that dll to cureect project folder and create one header file, in that file i used #pragma dll(MyFile)->MyFile is dll name.
But it is giving complier error...Plz help me ASAP.
Thanks,
Mohan.T
Mohan t working for N.I.C
|
|
|
|
|
mohant$.net wrote: But it is giving complier error...Plz help me ASAP.
The volume of your speakers is set too low so I'm unable to hear the error message. Can you please tell us what it is?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Thanks for ur replay
Below are the errors am getting:
testdll error LNK2019: unresolved external symbol _calling referenced in function _prttext
testdll fatal error LNK1120: 1 unresolved externals.
U have any other method to call the function means please forward me.....
Mohan t working for N.I.C
|
|
|
|
|
Have you declared _calling() after the #pragma directive?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
No,
I will try that
Thanks Much
Mohan t working for N.I.C
|
|
|
|
|
|
Hello,
i'm working on PC/SC smart card. i'm using microsoft's winscard.dll for smart card interaction. while sending a full 256 byte using SCardTransmit it is returning 0x0000000e (not enough memory). I tried to allocate memory by manually using malloc but still it's failing. Here is my code.
unsigned char photo_buff[21000];
div_t div_result;
char quo[2],rem[2];
photo_buff[0]=0xF5;
DWORD lReturn;
DWORD dwRecv;
DWORD last_block;
int size;
size=Convert_to_Hex((unsigned char *)photofinger_size_char,4);
photo_buff[1]=Hex_OP[0];
photo_buff[2]=Hex_OP[1];
last_block=(photofinger_size+3)/255;
memcpy(photo_buff+3,image,photofinger_size);
for(i=0;i<photofinger_size+3;i=i+255)
{
ZeroMemory(CmdBytes.bdata,sizeof(CmdBytes.bdata));
/*CmdBytes.bIns=0xD0;
CmdBytes.bCla=0x00;*/
send_buff_new[0]=0x00;
send_buff_new[1]=0xD0;
div_result=div(i,256);
itoa(div_result.quot,(char *)quo,16);
if(div_result.quot<16)
{
quo[1]=quo [0];
quo[0]=0x00;
}
Convert_to_Hex((unsigned char *)quo,2);
CmdBytes.bP1=Hex_OP[0];
itoa(div_result.rem,(char *)rem,16);
Convert_to_Hex((unsigned char *)rem,2);
CmdBytes.bP2=Hex_OP[0];
CmdBytes.bP3=0xFF;
memcpy(CmdBytes.bdata,photo_buff+i,255);
lReturn = SCardTransmit(hCardHandle,
SCARD_PCI_T0,
(PUCHAR)&CmdBytes,
256+5,
NULL,
pbRecv,
&dwRecv ); //lReturn returns 0x0000000e
}
return 1;
}
If anybody came across this problem please help me.
-----
deepakect
|
|
|
|
|
Hi,
Please let me know whether the below code right or wrong..
#include<iostream>
using namespace std;
struct a
{
int ty;
float d;
};
class A:public a
{
int b;
float se;
}
|
|
|
|
|
kumar sanghvi wrote: class A:public a
{
int b;
float se;
}
You're missing the terminating ; at the end of the class body. (plenty of nitpicks here - they'll point out that I missed this error).
Other than that, it's looking syntactically correct.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Did you try compiling it?
|
|
|
|
|
Hello,
I'm upgrading my MFC application to make use of some of the new user interface elements from the Visual studio 2008 feature pack. My first concern is upgrading my CToolBar to the pack's new CMFCToolBar, to use large icons, rollover buttons, etc.
I use much the same boilerplate code in CMainFrame::OnCreate() as ever:
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx (this, TBSTYLE_TRANSPARENT) ||
!m_wndToolBar.LoadToolBar (IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1;
}
However, no toolbar is visible when the application starts - it is simply omitted. Switching the class of m_wndToolBar from CMFCToolBar back to CToolBar once again makes the toolbar visible.
Why might the framework fail to display my CMFCToolBar? How can I fix the problem?
Regards,
Sternocera
|
|
|
|
|
this new feature pack stores the settings under the registry, so delete the workspace registry key under ur app key and try. alternatively in initinstance() u can call cleanState().
if this doesnt work then try creating a new sample toolbar and check if it works.
enjoy
Pras
|
|
|
|
|
Is MFC have any function that support draw shadow for rectangle, elipse, or round rectangle?
|
|
|
|
|
Not as far as I know but you can easily draw it your self: simply draw your shadow first by selecting a gray brush and drawing your shape with a certain offset (x and y). Then draw your original shape.
|
|
|
|
|
So, How to fade it?? Could you give me an example?
|
|
|
|
|
The MFC Feature Pack for Visual C++ 2008 [^] provides CDrawingManager class [^]. If you are using VS 2008 and MFC Feature Pack you can use DrawShadow method of CDrawingManager [^].
Regards,
Nuri Ismail
|
|
|
|
|
I can't find any information about CDrawingManager in MSDN document.
|
|
|
|
|
I've gave the links in my previous post, but i will paste them again:
1) CDrawingManager class -> here[^]
2) CDrawingManager::DrawShadow method -> here[^]
But remember that this class is a part of MFC Feature Pack for Visual C++ 2008. It will draw only rectangular shadows. If you are not using the MFC Feture Pack, you can download it from here[^].
Alternatively you can use CExtWndShadow class from this[^] article to draw rectangular shadows.
Both classes draw nice shadows, try them.
Regards,
Nuri Ismail
|
|
|
|
|
This is my code:
CRgn rgn;
rgn.CreateRoundRectRgn(left,top,right,bottom,x,y);
pDC->SelectClipRgn(&rgn);
pDC->RoundRect(left,top,right,bottom,x,y);
But it's wrong. Please help me!!!.
|
|
|
|
|
thanhvinh0906 wrote: But it's wrong.
What do you mean it's wrong ? Could you please describe your problem with more details ?
|
|
|
|
|
CRgn rgn;
rgn.CreateRoundRectRgn(left1,top1,right1,bottom1,x1,y1);
pDC->SelectClipRgn(&rgn);
pDC->RoundRect(left,top,right,bottom,x,y);
How to calculate left1, top1, right1, bottom1, x1, y1 for CreateRoundRectRgn(). if i use left1 = left, top1 = top, right1 = right, bottom1 = bottom, x1 = x, y1 = y. It doesn't bound round rectangle that i draw.
|
|
|
|
|
Whenever I plugin a usb mass driver into my pc, an autorun.inf file is creatd. When I monitored the running proccesses to determine which of them is doing so, I realized that even if I kill that process, another proccess begin to create that damn file again. I gussed there is a dll which is injected into all proccess running on my pc. Now I can't find out which module is doing all these functions ...
one more thing: anyone know umdmxfrm.dll?
Thank you masters!
|
|
|
|
|
Actually this is usually the behaviour of some Viruses.
Actually running process wont show the real process in taskmanager, example the case of ZPharaoh.exe(ZPharoah[^]).
Where you cannot even understand that which process is injecting the code.
since it destroys all the exe in the machine by infecting with itself.
Because those virus firstly dominates your registry and they remove your access to it along with msconfig and taskManager.
Your guessing is correct, if you want create a antivirus patch then just API Hook(API Hooking (LoadLibrary)[^]) the CreateProcess API to understand which all processes are created.
You have to hook those API at startup since some virus, hook the APIs before you.
umdmxfrm.dll(http://www.file.net/process/umdmxfrm.dll.html[^])
So what u can do is, use a good antivirus.
Величие не Бога может быть недооценена.
|
|
|
|
|
This board is for programming queries specific to C/C++/MFC.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Hi all,
I want to open a file on button click event of my program but i don't want to use ShellExecute. Can anybody please tell me any other api than ShellExecute
Thanks in advance
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|