|
Hi,
I'm developing a Activex with .net C++, i try to add a method that has both external and internal name into this activex, so that I can call this method ourside of this activex. but I can notfind a way to do this job as we do this with classwizard in VC.
So pls help me, if you know how to solve this problem?
thx.
Ray
|
|
|
|
|
:(Hello Friends,
We are making a VC++ . net designer control by wrapping an mfc control we are already having.But when I place the control in the toolbox, by selecting the control dll , there is some unhandled exception happens and the proces is terminated.This problem is not happening when I place the control by copying and pasting form some existing samples using this control ,made previously by another developer.That is once this control is copied and placed on some design form, there is no problem in adding this control to the tool box.
while debugging I could see the _DllMainCRTStartup() function is repeatedly called .Each time DllMainCRTStartup is called the application slows down and finally an unhandled exception is being thrown.
We are using the .NET Framework 1.0 version 1.0.3705
and IDE 2002 version 7.0.9466
Please help me...Thankz in advance
Sathyan
|
|
|
|
|
I was trying to add a custom contorl to the tool box , the IDE was crashed .I tried with a simple class that derived form control that too could not be added to the toolbox when placed within this assembly(same result the ide was crashed).
The call stack is like the following.
ntdll.dll!77f827e8()
kernel32.dll!77e86a3d()
user32.dll!77e2481d()
user32.dll!77e24600()
user32.dll!77e3a1ab()
ntdll.dll!77fa032f()
user32.dll!77e1569d()
msenv.dll!50080965()
msenv.dll!50080939()
the error message got was
Unhandled exception at 0x096cb860 in devenv.exe: 0xC0000005: Access violation reading location 0x096cb860.
is it due to some problem with the dll since it was made by wrapping an mfc control..
Friends plz tell me due to what reason the this is happening..
Sathyan
|
|
|
|
|
Even though the traffic seems to be relatively small here, I'll go ahead and ask anyway. I'm writing a managed dll in C++ (actually it's an NUnit test dll), and I need to be able to get the dll's HINSTANCE - to either load resources or to call GetModuleFileName( ). So far I've tried the following:
<br />
_pModule->get_m_hInstResource( )<br />
_pModule->get_m_hInst( )<br />
::GetModuleHandle( NULL )<br />
AfxGetResourceHandle( )<br />
AfxGetInstanceHandle( )<br />
But no luck. They just return NULL. Has anyone had any similar problem in the past, and if so, what did you do to solve it?
Daníel
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Because its a managed DLL, I think the best approach would be to
get at the Resources via
using System::Reflection
__gc Assembly* Assembly;
__gc ???* [] mResults; //Don't recall the return type.
mResult[] = Assemble->GetExecutingAssembly()->GetLoadedModules(true);
And then walk the array of objects filtering for IsResource() property.
|
|
|
|
|
Hi all!
I have a problem with letting the compiler accept the following code, see example below.
I have a logfile that contains statements about variuos actions taken during an installation. The actions are a value of a enum type itemOper = {FileCopy, FileMerge, FolderOk, ...} which is written to the logfile by Enum::GetName(__typeof(itemOper), oper), where oper has one value of the enum type. No FlagAttribute are used.
When i later read the logfile I want to translate the text "FileCopy" back into a value of type itemOper. It works fine in runtime with the debugger and the following code:
Object * item = Enum::Parse(__typeof(itemOper), S"FileCopy");
If i set a breakpoint at a line after this statement the debugger show that the variable item has the value "FileCopy", thats fine!! Now to the problem. The compiler does not allow any cast's or a switch(oper) statement!!!. It does not accept a "if (oper == itemOper::FileCopy)" and so on.
What to do, the base class Enum is usable at some point, but here I'm stuck.
Does anybody know how to "fool" the compiler or does anybody have the right solution??
/Thanks
|
|
|
|
|
I found the answer!!
I have to unbox the value from the returned Object
itemOper oper = *dynamic_cast<__box itemOper*>(item);
|
|
|
|
|
Hi everybody,
I have downloaded latest swfsource form www.sourceforge.com
I am trying to build swfsource using VC++ .NET, but while linking it showing many LNK2005 errors.
I tired /FORCE:MULTIPLE option in Project->Properties->Linker->Command Line, and this option helps me to remove those errors and forcely link swfsource successfully.
This force linking is not generating full swfsource.exe file.
Can anybody suggest me some better solution, which does this linking in normal ways(i.e. without forcefully)?
I am listing down some of those LNK2005 errors that i am getting, below:
Linking...
animate.obj : error LNK2005: _Int64ShllMod32@12 already defined in 8bim.obj
animate.obj : error LNK2005: _Int64ShraMod32@12 already defined in 8bim.obj
animate.obj : error LNK2005: _Int64ShrlMod32@12 already defined in 8bim.obj
annotate.obj : error LNK2005: _Int64ShllMod32@12 already defined in 8bim.obj
annotate.obj : error LNK2005: _Int64ShraMod32@12 already defined in 8bim.obj
annotate.obj : error LNK2005: _Int64ShrlMod32@12 already defined in 8bim.obj
art.obj : error LNK2005: _Int64ShllMod32@12 already defined in 8bim.obj
art.obj : error LNK2005: _Int64ShraMod32@12 already defined in 8bim.obj
art.obj : error LNK2005: _Int64ShrlMod32@12 already defined in 8bim.obj
attributes.obj : error LNK2005: _Int64ShllMod32@12 already defined in 8bim.obj
attributes.obj : error LNK2005: _Int64ShraMod32@12 already defined in 8bim.obj
attributes.obj : error LNK2005: _Int64ShrlMod32@12 already defined in 8bim.obj
avi.obj : error LNK2005: _Int64ShllMod32@12 already defined in 8bim.obj
avi.obj : error LNK2005: _Int64ShraMod32@12 already defined in 8bim.obj
avi.obj : error LNK2005: _Int64ShrlMod32@12 already defined in 8bim.obj
avs.obj : error LNK2005: _Int64ShllMod32@12 already defined in 8bim.obj
avs.obj : error LNK2005: _Int64ShraMod32@12 already defined in 8bim.obj
avs.obj : error LNK2005: _Int64ShrlMod32@12 already defined in 8bim.obj
blob.obj : error LNK2005: _Int64ShllMod32@12 already defined in 8bim.obj
blob.obj : error LNK2005: _Int64ShraMod32@12 already defined in 8bim.obj
blob.obj : error LNK2005: _Int64ShrlMod32@12 already defined in 8bim.obj
bmp.obj : error LNK2005: _Int64ShllMod32@12 already defined in 8bim.obj
bmp.obj : error LNK2005: _Int64ShraMod32@12 already defined in 8bim.obj
bmp.obj : error LNK2005: _Int64ShrlMod32@12 already defined in 8bim.obj
cache.obj : error LNK2005: _Int64ShllMod32@12 already defined in 8bim.obj
there are total around 355 errors of these types..
Please help me..
Thanks in advance..
ADARSH KUMAR SINGLA
S.E.BIZ. INFOTECH. PVT. LTD.,
Chandigarh.
|
|
|
|
|
I think the errors are coming from around line 647 of WinNT.h, because the __inline keyword is being ignored. Perhaps your project has a macro called __inline ?
|
|
|
|
|
Hi Mike..
Thankyou very much for replying me...
I find the line 647 in WinNT.h file and looked at the respective keyword
The code at line 647 is as follows:
__inline ULONGLONG
NTAPI
Int64ShllMod32 (
ULONGLONG Value,
DWORD ShiftCount
)
{
__asm {
mov ecx, ShiftCount
mov eax, dword ptr [Value]
mov edx, dword ptr [Value+4]
shld edx, eax, cl
shl eax, cl
}
}
__inline LONGLONG
NTAPI
Int64ShraMod32 (
LONGLONG Value,
DWORD ShiftCount
)
{
__asm {
mov ecx, ShiftCount
mov eax, dword ptr [Value]
mov edx, dword ptr [Value+4]
shrd eax, edx, cl
sar edx, cl
}
}
__inline ULONGLONG
NTAPI
Int64ShrlMod32 (
ULONGLONG Value,
DWORD ShiftCount
)
{
__asm {
mov ecx, ShiftCount
mov eax, dword ptr [Value]
mov edx, dword ptr [Value+4]
shrd eax, edx, cl
shr edx, cl
}
}
The solution suggested by you seems to be very beneficial to me..
but, i am not getting the solution suggested by you regarding __inline keyword in WinNT.h file,
So, Please suggest me solution in detail i.e. what i have to do to remove this error..
Thanks in advance.
ADARSH
S.E.Biz. Infotech Pvt. Ltd.,
Chandigarh.
|
|
|
|
|
can we send a two dimensional array as an argument????
|
|
|
|
|
Can any experts in MFC application be kind and show me the way to setting the /clr options in MFC application type? There are too many restrictions and constraints (not compatible with /Gm, /ZI....etc) with this option on.
Currently cant seem to include "using <mscorlib.dll>" in MFC application. Any one care to tell me why and any solution? many thanx..
- -sC- -
|
|
|
|
|
can someone tell me how do i read inputs from a text file?
(im still a beginner in C++,iv pored through a number of books but none has enlightened me..:sigh
the input is made of a hexadecimal number on each line, till the end of the file. the hex numbers represent an 8-bit number.
how do i convert the hex number to binary instead, upon reading it?
im aware that each character will be read in ASCII (correct me if im wrong)and stored into an array before the programmer can convert it to hex instead. but i dont know how the coding is like.
if im not mistaken, each input will be placed in a [1x8] array (or matrix). how do i change it into an [8x1] array instead, with the bit-0 placed as the first element of the new [8x1] array?can someone tell me the exact code please?
many thanx..
|
|
|
|
|
You're not getting much response to this, are you? Okay, though I'm a beginner, too, I'll take a crack at it...
First, to read the file you can use fopen and streams, or CFile and a character buffer. Streams make me crazy, so I don't use them yet, but you may have better luck with them.
Converting the individual characters to integer values is easy. Use isdigit(ch) on each character read to find out whether it's in the range 0 to 9. If it is, use atoi(ch) to return the value as an integer. For characters A to F, I'd first check using isalpha(ch) to filter out carriage returns and such, then apply toupper(ch) to make them upper case, then a Select (oops) Switch statement to set the values (case 'A': value=10; case 'B':value=11; etc).
Combining two input characters into a one byte hex number is straighforward, I think. I'd try taking the first int value and shift it left (value<<4) by four bits, then add the second value to it. The lower byte of the int result should be the binary value you're looking for.
As for the rest - I don't understand the question well enough to guess. Could you clarify what you're trying to do with the array thingy?
As I said, I'm a beginner too, so any of the above may be entirely wrong. But that's the approach I'd start with, then let the many error messages that result lead me to a correct solution. Hopefully this is enough to get you started. Good luck!
Heard in Bullhead City - "You haven't lost your girl - you've just lost your turn..." [sigh] So true...
|
|
|
|
|
hmmm...
i won't give you the 'exact code' because this sounds like a homework question, but i will do this for you...
1. a [8x1] matrix is the transpose of a [1x8] matrix, hence they are identical (in the case of [qx1]/[1xq] matrices).
2. if you use a 'vector' type like a queue or a stack, then this will be your 'vector', else just create an array, i.e. char a[8];
3. assuming the number you are talking about is a character that represents a hex number like "^B" = 0x02h or "^J" = 0x08h, then what you will need to do is to bitwise 'AND' (which is a singular & not the AND operator which is &&) each bit position to find out whether the bit is set or not...
eg:
10010110 &<br />
00000010<br />
========<br />
00000010<br />
to do that calculation you would do something like
(var & 0x02)? 1:0;
i.e. if the result of the bitwise & is true return 1 else return 0.
so, you will need to bitwise AND it with
0x01
0x02
0x04
0x08
0x10
0x20
that should give you enough of the pattern for you to do the rest yourself...
4. finally, you can place the result of the bit in any order you want...
as for storing the ASCII character in an array first, this is highly unnecessary, you should be able to process each character as it comes through the stream...
try that, show me your results and if it looks like you need more help, we can try from there...
hope this 'enlightens' you a little more... the joy of programming is the 6 weeks of frustration followed by a fleeting 'ah' that signals the moment of complete enlightenment... it is the drug all programmers work towards...
cheers and good luck
nik
Nik Vogiatzis
PhD Candidate: University of South Australia
+++++++++++++++++++++++++++
Developing new generation Traffic Micro-simulation Tools for Traffic Engineers
em: nikolaos.vogiatzis@unisa.edu.au
|
|
|
|
|
Hi,
Is there any article available here which gives me an idea of connecting a c++ application to the database. I want to write a console database application. I don't want to use the MFC classes.
Can anyone help me, pls? Thanks in advance..
regards,
vini
|
|
|
|
|
Hello,
try this,
http://www.codeproject.com/managedcpp/adodemo.asp
With Regards,
R.Selvam
|
|
|
|
|
Hi everybody!
I encountered the following problem:
I created a "class library (.NET)" project and made a first build, which produced a warning:
nochkclr.obj : warning LNK4099: PDB 'libc.pdb' was not found with 'C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\lib\nochkclr.obj' or ...[/quote]
Ok, I ignored this warning and used the Wizard to generate a "Generic C++ class" with a virtual destructor. When I now try to rebuild my project I get two linker errors:
wiz.obj : error LNK2001: unresolved external symbol "void __cdecl operator delete(void *)" (??3@$$FYAXPAX@Z)
and
wiz.obj : error LNK2001: unresolved external symbol "void __stdcall `eh vector destructor iterator'(void *,unsigned int,int,void (__thiscall*)(void *))" (??_M@$$FYGXPAXIHP6EX0@Z@Z)
When I remove the "virtual" keyword in front of the destructor declaration both linker errors disappear!!! What the @&%$ is going on here?!?!
Thank you for your help,
Matej
|
|
|
|
|
Hi everybody..
I have downloaded latest swfsource from www.sourceforge.com
It is a very good swfsource, which includes almost all the required features..
I gone through this swfsource, and became successfull in drawing simple shapes like rectangle, circle, triangle, curved-edged rectangle.....
I also tried drawing Gradients and buttons using this swfsource, but still not succeded..
Can anybody help me by sending the code(in swfsource) for drawing Gradients and Buttons?
thax in advance..
with regards,
ADARSH
Junior S/W Developer,
SEBIZ INFOTECH PVT. LTD.,
CHANDIGARH.
|
|
|
|
|
how can i use a licensed control in managed vc++??
in c# when you add a licensed control to a form you get an embedded resource ("licenses.licx") file that tells vs.net to compile the license into the host app..
how does this work in vc++?
//Roger
|
|
|
|
|
Hi everybody:
I'm doing my first application in .NET.
I know how use in my application the Visual Xp Styles.
//before running in main form.
Application::EnableVisualStyles()
But, is not exactly that I want. I only want get, at runtime, the name ( or any other ID ) of the current actived Theme from OS Windows, and (if is XP) current actived Visual Style.
Can anybody help me?
Advanced Thanks.
Best Regards.
|
|
|
|
|
Hello all,
I have an application, where I want to share an array between all member functions of the class. I have tried everything I can think of, but with no luck.
In my constructor (which works fine) I have:
Button * button __gc[] = new Button() * [20];
But I can not access that array outside of the constructor, and I can not declare the array as a public member of the class...
Any help would be great.
Thanks,
Paul
|
|
|
|
|
Hi,
Dose anybody know where can i download "Server 2003 DDK", and i need to write a program to comunicate and transfer files with a remote computer via modem with this protocols (ZMODEM/XMODEM), can you send me some hint or source code links to help me to start it.
Thanx in advance.
|
|
|
|
|
How would I get an application to register a keydown, keyup, or keypressevent while it is minimized?
James Meade
vENS vUSN
vOPSOFF VAQ-140
|
|
|
|
|
hi all...
my problem seems fairly straight forward, but, here goes...
i have a struct definition that uses bit fields (want to keep that), but i need it called from a managed class...
i know i can't do that unless the struct is also managed... any way i can do this without loosing the bit fields?
e.g.
struct SVSRecTypeA<br />
{<br />
unsigned year :12;<br />
unsigned mon :4;<br />
unsigned day :5;<br />
unsigned hr :5;<br />
unsigned min :6;<br />
unsigned char timeperiod;<br />
};<br />
<br />
public __gc class Class1<br />
{<br />
SVSRecTypeA *s;<br />
};<br />
the code above i know will cause an error, but using public __gc struct Struct will also fail if i include the bit fields...
can anyone point me in the right direction?
cheers
nik
Nik Vogiatzis
PhD Candidate: University of South Australia
+++++++++++++++++++++++++++
Developing new generation Traffic Micro-simulation Tools for Traffic Engineers
em: nikolaos.vogiatzis@unisa.edu.au
|
|
|
|
|