|
Hi and thanks in advance,
I have implemented a DLL language system for my app, but I can’t open the dialogs with a DLL language loaded if this contents any custom control. When I do the dialog.DoModal (); it returns some error (I think it is caused by some template), the dialog don’t appear and the execution continues. If I try to open the same dialog without have loaded any DLL or if the dialog doesn’t contents anyone custom control, the system runs properly. I don’t know what can I do.
Your help will be appreciate, thank you very much.
|
|
|
|
|
I want to insert icons on to any cell in the FlexiGrid control. Does anybody know how to go about this?
Sharat
|
|
|
|
|
I have to develop an assembler based on the below processor description :
M05 is a new generation processor from Lintel Technologies. It is a simple 16 bit
multipurpose processor targeted for consumer electronic devices .It has a 16 bit accumulator
A , 16 bit flag register , a 16 bit data register D and a 16 bit memory pointer register P .
It also has a 16 bit Program Counter register PC and a Stack pointer SP.
It supports the following instructions .
* Move immediate data to A,D,P and SP
* Move data pointed by P register to A or D
* Perform arithmetic operation on A register with D register( add ,sub , adc , sbb ,xor
,or ,etc)
* Move data in A register to memory pointed by P
* Call subroutine and return
* Unconditional and conditional jump ( ie jump or carry etc)
* Jump to or call to address pointed by A
The registers A and D can be accessed as 8 bit units ( AH ,AL , DH , DL)
List down the set of all possible instructions and assign your own opcodes. Your assembler
should accept decimal and hexadecimal data . HExadecimal numbers start with a '0' prefix and
terminate with a literal 'H' - for example 0FFEFH . Any text that follows ";" in the same
line should be treated as a comment . Assure that the assembler is case insensitive.
|
|
|
|
|
Good luck with that pal!
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
|
Do you really expect that someone will make the entire job for you ?
|
|
|
|
|
Stlan wrote:
Do you really expect that someone will make the entire job for you ?
WHAT About RENT-A-CODER
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I spent tons of time trying to get this working, and it looks like I need someone' help.
I have three C++ functions in a DLL. One creates an object and returns pointer to this object. Second accepts the pointer of an object, and calls one of the object's member functions. Third deallocates memory. When #1 and #2 are in one function, everything works fine. When they are split, the application crashes.
Maybe there is something wrong with my setup? Is there a chance that memory gets deallocated in between somehow? Please help. Thank you.
Function #1
===========
long _stdcall InitClient( char* cErrStr )
{
CBLZQuoteManager* pQuoteManager = NULL;
CMyQuotesClient* pQuotesClient = NULL;
pQuoteManager = (CBLZQuoteManager *)(CBLZQuoteManager::GetInstance(RUNTIME_CLASS(CBLZQuoteManager)))
pQuotesClient = new CMyQuotesClient();
....
return ( long )pQuotesClient;
}
Function #2
===========
short _stdcall GetQuote( long lPtr,
double& dResult,
char* cErrStr )
{
CMyQuotesClient* pQuotesClient = ( CMyQuotesClient * ) lPtr;
pQuotesClient->DoSomething();
....
}
VB.NET side
===========
Public Declare Function InitClient Lib "quotes.dll" () As Long
Public Declare Function GetQuote Lib "quotes.dll" _
(ByVal lPtr As Long, ByRef dResult As Double, _
ByVal sError As String) As Short
......
lPtr = InitClient()
nReturn = GetQuote(lPtr, dResult, sError)
.....
|
|
|
|
|
Here's a small sample showing how i'm doing it wrong :P
I tried the gnu compiler, cause sometimes other compilers give better insight, and it told me that the friend declaration specifies a non-templated function and told me to add <> after the function name...but didn't work out. Help please.
#include <iostream>
using namespace std;
template < class Type >
class Template
{
public:
Template(Type value) : Value(value)
{ }
Type Value;
/* Overloaded stream operators ********************************************/
friend ostream & operator << <>(ostream &, const Template < Type > &);
friend istream & operator >> <>(istream &, Template< Type > &);
};
template < class Type >
ostream & operator <<(ostream & os, const Template< Type > & point)
{
os << point.Value;
return os;
}
template < class Type >
istream & operator >>(istream & is, Template< Type > & point)
{
is >> point.Value;
return is;
}
int main()
{
Template < int > tes(3);
cout<
|
|
|
|
|
'Do not treat <'s as HTML tags' will allow us to read your code. I also have articles on this site about iostream inserters and extractors.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I fixed the <'s...will look for your articlles tomorrow...gettin late over here.
|
|
|
|
|
Hello,
The following code works for me on a VC compiler:
template<class> class Template;
template< class T >
std::ostream& operator << (std::ostream& ost, Template<T> value)
{
return ost << value.m_t;
}
template <class T>
class Template
{
public:
template<class T>
friend std::ostream& operator <<(std::ostream& ost, Template<T> value);
private:
T m_t;
};
The point is that you use a template parameter in a non-template function declaration. Therefore you have to make your operator a template function too.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Thanks! your example helped me make it work
Here's a shortened version of the class i needed it for...It works in gnu and vs.net
<br />
<br />
#ifndef POINT_H<br />
#define POINT_H<br />
<br />
<br />
#include < iostream ><br />
using namespace std;<br />
<br />
template < class Type ><br />
class Point<br />
{<br />
<br />
public:<br />
<br />
Point(Type x = 0, Type y = 0) : X(x), Y(y)<br />
{ }<br />
<br />
Type X, Y;<br />
<br />
<br />
<br />
template< class T ><br />
friend ostream& operator <<(ostream &, const Point< Type > &);<br />
<br />
template< class T ><br />
friend istream & operator >>(istream &, Point< Type > &);<br />
};<br />
<br />
template < class Type ><br />
ostream & operator <<(ostream & os, const Point< Type > & point)<br />
{<br />
return os << "(X: " << point.X << ", Y: " << point.Y << ")";<br />
}<br />
<br />
template < class Type ><br />
istream & operator >>(istream & is, Point< Type > & point)<br />
{<br />
return is >> point.X >> point.Y;<br />
}<br />
<br />
#endif //POINT_H<br />
<br />
|
|
|
|
|
You're welcome
FocusedWolf wrote:
using namespace std;
A little bit of advise: never and I mean NEVER use a using statement in a header file. I may not cause problems directly, but if you start to work on large projects or libraries that will be used by third party people, this little statement is likely to cause some nasty trouble.
The reason for this is the following: the using SomeNamespace keyword brings all the declarations in of SomeNamespace into the current namespace (in your case the global namespace). This feature is often called polluting a namespace. This could cause name clashes with other namespaces or whatever. This problem is hard to track down.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Hello,
Here's my problem. I have a CListCtrl that supports in-place editing. I need to capture the Return key and notify the parent dialog that Enter has been pressed. I've tried the following:
void CInPlaceEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// If Enter has been pressed, we need to post a WM_KEYUP message to our parent dialog.
if(nChar == 13)
{
// Get a handle to our dialog window
CWnd* pDialogWnd = NULL;
pDialogWnd = GetParent();
// Post the message to our dialog window
pDialogWnd->SendMessage(WM_KEYUP, VK_RETURN, 0);
}
...
I think I'm going about this the wrong way but I'm not sure of the right way to do it. Any help would be greatly appreciated! I'm Stuck!
Thanks!
-Ian
|
|
|
|
|
You need to either create a custom message ( why does the keyup HAVE to mean something happened in a child dialog ? ), or pass an instance of the parent through to the child, and call a method on it directly. I'd define the method in an abstract class and derive from it, so that it's easy to change the parent dialog.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I was using the keyup message because the code used to be in a CEdit-derived class in the WM_KEYUP handler.
A custom message would work, but I'm having trouble getting a handle to the dialog...
-Ian
|
|
|
|
|
I need some help for my project. i'm using MFC C++.
Actually i need to write a program tat can select the wanted region on an given image(256 by 256) to compute some calculation.... but before i can compute the calculation i need to differentiate the selected region i wan and the region tat is unwanted... so the wanted region i need is the thickness of hollow cylinder.... i need to draw a bigger circle first capture the pixel selected and store in a array call (Index [r][c]) and follow by drawing a smaller circle in the bigger circle capture the pixel in a array call (index_inner[r][c])...the wanted region is between the bigger and the smaller circle...
can u give me some tip for how to wirte the program
|
|
|
|
|
This sounds to me like a problem you should be able to solve without any interaction with a bitmap at all. You should be able to mathematically work out which pixels will be inside the first circle, then knock out any pixels that occur in the second.
But if you want to store the pixel values also, then you need to create a DIBSection, so you have a pointer to the pixel values. Then use a 24 or 32 bit bitmap so that the pixel values are stored there in an easy to read format. Or you can use GDI+, then the code looks the same as the pixel access code in my image processing articles ( which are in C# ).
Don't use get/setpixel unless speed is not an issue.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
My image used actually is black and white, it not colour..
sorry i didn't mention to u...
|
|
|
|
|
It's a 2 bit image ? OK - well you can either work out how to iterate through it by bitmashing, or you can convert it to 8 bit using GDI+ ( because they each byte will contain one pixel, and you'll just need to work out which palette value is black and which is white ).
So you have a 2 bit image, and you want to work out the pixel values within a donut, is that right ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Dear all:
I am now conducting a project that supports recording videos from TV card. I am wondering if some has similar experience such as capturing videos(using DirectShow) from analog TV card or USB webcam.
Please let me share your experience if possible.
Thank you very much.
Jeffrey
|
|
|
|
|
Is DirectShow on WinCE signifiacantly different from
DirectShow on Windows XP, etc? If not, and if it would
be any use I could "share my experince", which started
with my stumbling through the Amcap sample source code
and finished with my writing a full featured, skinable
video capture application and understanding a heck of a
lot more about DirectShow Filtergraphs than I did before.
Steve T
|
|
|
|
|
Steve:
Thanks a lot for your information.
Yes, there are a lot of differences between WinCE and XP as far as Directshow is concerned. For example, most filters are not supported in WinCE.
Actually, my previous project on XP started from amcap, too. However, when I migrated it from XP to CE, I found a lot of things needed to be done...
Jeffrey
|
|
|
|
|
This morning, I tried to create an instance for a Capture Graph Builder using the following code:
hr = CoCreateInstance(CLSID_CaptureGraphBuilder2, NULL,
CLSCTX_INPROC_SERVER, IID_ICaptureGraphBuilder2, (void**)&pBuild);
Unfortunately, it returns REGDB_E_CLASSNOTREG, which indicates "A specified class is not registered in the registration database. Also can indicate that the type of server you requested in the CLSCTX enumeration is not registered or the values for the server types in the registry are corrupt."
I check the corresponding registrey in WinXP, the CLSID_CaptureGraphBuilder2 is associated with the qcap.dll, which does not exist in WinCE.
Does anybody has the solution? Thanks a lot.
Jeffrey
|
|
|
|