|
I suspect that your buffer b does not contain the two bytes of value x1B and E. Try hardcoding the Escape call to pass "\x1BE" and a length of 2.
EX: cdc.Escape(PASSTHROUGH,2,"\x1BE",NULL);
onwards and upwards...
|
|
|
|
|
I tried this code.
EX: cdc.Escape(PASSTHROUGH,2,"\x1BE",NULL);
But i'm getting the following compile time error.
: error C2022: '446' : too big for character.
i tried this code in this manner also.
EX: cdc.Escape(PASSTHROUGH,2,"\x1B\x45",NULL);
now the complie time error gone but it's gives a "memory could not be read" run time error.
Hope you will be able to nail it down.
|
|
|
|
|
Are you compiling with unicode?
onwards and upwards...
|
|
|
|
|
Hi !
I'd like to know if it's possible to have a template class being friend of another template class to access it's private members.
For example, I'd like the class CTreeNode<T> to be friend of CTree<T>.
I tried several syntaxes :
friend class CTree;
friend class CTree<T>
but it didn't work and I cannot think of another syntax.
How can I do this ?
Thanks !
Jerome
|
|
|
|
|
if parameter T is the same in both case, typing that would be good :
<font style="color:blue">template class</font> CTree<<font style="color:blue">typename</font> T> {
<font style="color:green">
<font style="color:blue">public</font>:
<font style="color:green">
<font style="color:blue">friend class</font> CtreeNode<T>;
};
TOXCCT alias Nicolas C.
|
|
|
|
|
hi all,
i'm ashamed to ask such questions, but i can't even figure it out how i can form a query to search for this on the web site or the internet...
1. i need to mimic standard menu items from user-defined ones... let me explain, MFC - standard MDI app (made by the wizard) has few standard menu items (File->Open... for example). Now i made a dilog, which has a button in it, and if the user clcks that button, the handler must act like it's a standard CDocument::OnOpenDocument(...) method. I know, I can construct CFileDialog myself, show it to the user and call CMyDoc::OnOpenDocument(string)... but this will defeat Doc-View approach... What can i do? Just send the message ID_FILE_OPEN... to what window than??
2. right button click and a popup menu appears. what's it name? where can read more about it?
thanks for your time!
alex
debug - is my life style
|
|
|
|
|
lobanovski wrote:
2. right button click and a popup menu appears. what's it name? where can read more about it?
It is called a "context menu". MSDN and CodeProject have information on them.
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
I'm trying to design some generic callbacks, which works well enough (using similar techniques to Andrescu's ScopeGuards[^]), except for the return value of the callback function.
for void, it#s simple:
struct CCallback { virtual void Call() = 0; }
template <class T>
struct CCallbackFunc_0 : public CCallback
{
T func;
CCallbackFunc_0(T func_) : func(func_) {}
void Call() { func(); }
};
template <class T>
CCallback * CreateCallback(T func_)
{
return new CCallbackFunc_0<T>(func_);
}
Now I figure I could have two separate branches, one templatized over the return type, but this makes a lot of code, and breaks the nice syntax for using CreateCallback.
Any ideas? Suggestions? Other approaches?
Flirt harder, I'm a coder.
mlog || Agile Programming | doxygen
|
|
|
|
|
Have you tried using a template, specifying void as the return type? The compiler will spit out a warning (not an error) if a void function returns a value, which you can safely ignore.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I'd like to be able to receive the return value when I do the "Call" through the base class (hence the idea of templating the base class over return type)
Flirt harder, I'm a coder.
mlog || Agile Programming | doxygen
|
|
|
|
|
i would like to build an application to communicate with the Proxy. hw to do it
Thank You
|
|
|
|
|
I cant give you direct solution, but can give you pointers.
you need to know which proxy you are targeting,
HTTP 1/1 proxy, or sock, etc
mostly it is HTTP 1/1 proxy, so if you could refer the RFC for HTTP you will know how to do it.
regards,
Prakash.
Toughest Steel Comes From Hottest Furnance
|
|
|
|
|
Hi !
I'd like to try to write a very simple RSS reader, but...well, I have no idea where to start.
I've seen that I would need to read an XML file at a specific internet address and parse this XML file, but I'm wondering how other readers work : do I have to poll every x minutes the RSS feed and check for new informations or is there a way to get informed when new info is available ?
Thanks for your help !
Jerome
|
|
|
|
|
Jerome Conus wrote:
do I have to poll every x minutes the RSS feed and check for new informations or is there a way to get informed when new info is available
He he. Welcome to the wonderful world of RSS. You've just found one of the many cans of worms that litter this particular landscape. RSS 2.0 has a way of notifying clients when things have changed but nobody bothers with it.
RSS Bandit[^] is open source so that should get you started.
Awasu is, of course, way cooler but I'm not giving away any source
Lets be honest, isn't it amazing how many truly stupid people you meet during the course of the day. Carry around a pad and pencil, you'll have twenty or thirty names by the end of the day - George Carlin
Awasu 1.2 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
I am trying to interface my C code converted from Matlab with OpenCV.
I tried to get OpenCV to display the image I got from the Matlab
converted C code, but I got a BLACK IMAGE.
- FG is of mxArray * type.
- Using mxGetPr(FG) is supposed to return me the pointer to first
element of FG.
- Then I tried to capture the data in FG in char_ptr.
- And pass in the data in char_ptr into oImage->imageData.
- But all I get is a black image.
- Below is my program:
Can anyone please tell me what is wrong?
/*assigning the ouput from Matlab converted code to FG*/
mlfAssign(&FG, mlfIndexRef(mclVv(class0, "class"), ".FG"));
int m = mxGetM( FG );
int n = mxGetN( FG );
double * double_ptr = 0;
char char_ptr[240][320];
int i, j, count = 0;
double_ptr = mxGetPr( FG );
for(j=0;j<n;j++){
for(i=0;i<m;i++){
char_ptr[i][j]=(char)(*(double_ptr+count));
}
count++;
}
oimage =="" cvcreateimage(="" cvsize(n,="" m="" ),="" ipl_depth_8u,="" 1="" );
oimage-="">imageData = *char_ptr;
cvSaveImage("outputFG.jpg", oImage);
Please help...
pistachio
|
|
|
|
|
HI,
i m begginer.
I want to get the handle of a Dialog , that i created after cliking on a button . (for both .. Modless and model)
plz tell me.
thanx
|
|
|
|
|
Hello,
The handle is a member of the CDialog object - m_hWnd.
I think this will be NULL until you have called the Create function on a modeless window.
Regards,
Simon
|
|
|
|
|
Use GetParent() from the button.
John
|
|
|
|
|
I want to use Icon overlay for my files.
What i ve to do with the folowing method of IShellIconOverlayIdentifier
Methods are
GetOverlayInfo
GetPriority
IsMemberOf
|
|
|
|
|
Hi all,
I want to create a web browser plugin.But i don't know from where to starts.
.
Any help to start will be a great
Thanks in advance
AL
|
|
|
|
|
Which web broser are you talking about,
if IE there are samples in CodeProject,
if Netscape visit www.fundocode.com
Toughest Steel Comes From Hottest Furnance
|
|
|
|
|
Hi Prakash,
I want to write IE Browser Plugins.I need something like Adobe Reader.Also I would like to difference between Browser Helper Object and Plugin.
Again,thanks in advance.
AL
|
|
|
|
|
Sorry i dont have much info about that, but there are ie plugin samples using wtl here on cp.
Toughest Steel Comes From Hottest Furnance
|
|
|
|
|
hello firends,
how can i convert text into image programmitically.
|
|
|
|
|
Draw the text into a device context using TextOut or DrawText, then get the bitmap from the device context.
onwards and upwards...
|
|
|
|