|
Hello,
Once I got a debug error and from then I am not getting any info in Class Wizard. I did rebuild the project but when I press Ctrl W I am getting this error
Parsing error Expected "virtual"
Input Line "void KILLFOCUS(WPARAM wParam,LPARAM lParam)"
Thanks
Prithaa
|
|
|
|
|
At KILLFOCUS you created in the Class Wizard does not exist.or is not a virtual function.KILLFOCUS in front of you to add at virtual.
|
|
|
|
|
prithaa wrote: Input Line "void KILLFOCUS(WPARAM wParam,LPARAM lParam)"
Is the capitalization correct?
"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
|
|
|
|
|
|
I need to write a PC based application that will utilize a bluetooth dongle using the Microsoft Bluetooth Stack. I was looking for any recommendations on SDKs (comercial or otherwise) that anyone would recommend. Or are the Bluetooth apis well documented enough on the MSDN that no 3rd party SDKs are needed?
Thanks in advance
|
|
|
|
|
What do you need the dongle to do?
As long as it appears in the Device Manager, then all it's capabilities are available. If it's a network device, then it should act like all the other network devices, if it's a sound device, then it should appear in the sound device list.
|
|
|
|
|
The dongle is because the PC won't necessarily have any integrated bluetooth. I just need to be able to connect to a external BT device whose BT address I will receive at run-time and then I need to perform some OBEX transfers in both directions.
I haven't done any windows network programming so this would be new to me.
|
|
|
|
|
Have you looked at http://www.openobex.org/
|
|
|
|
|
Hello,
I'm writing an application that needs to interface with a Maxatec MT-200 receipt printer. This is done through posting bytes to the device. I have successfully changed character encodings and made text bold in the past, so my basic approach is sound.
I am working off the MT-200 technical manual, but I don't seem to be having much luck getting it working printing monochrome bitmap images (bitmap in the traditional sense, 1-bit per pixel).
ftp://ftp.maxatec-europe.com/Public/Maxatec/MT-200_Technical.pdf[^]
Look to page 59 and 60, defining and printing a downloaded bit image. It certainly has me confused.
[Name] Define downloaded bit image
[Format] ASCII GS ∗ x y d1 ... d (x x y x 8)
Hex 1D 2A x y d1 ... d (x x y x 8)
Decimal 29 42 x y d1 ... d (x x y x 8)
.................
The number of dots in the horizontal direction is x x 8, in the vertical
direction it is y x 8.
Surely the number of horizontal dots is the number specified by x. Does it simply mean x must be a multiple of 8? When I write the following bytes to the device:
1D 2A 10 10 66 66 66 66 66 66 66 66
in an effort to define a downloaded device image, the device becomes unresponsive - it doesn't print any additional ascii bytes I might send. It certainly doesn't respond to the print dowloaded image command:
1D 2F 30
What should I do? Can anyone make sense of this documentation? I myself cannot work it out, so I'd appreciate if someone else could weigh in,
Regards,
Sternocera
|
|
|
|
|
My suspicion is that the printer has an 8x8 dot head.
So, anything it prints will have to be in multiples of 8. But they then have a choice. Ask people to set the size, but trust them to set the size on multiples of 8? Or make the parameter be number of "heads", rather than number of dots.
So, you send:
9x3, which means 9 heads wide, and 3 heads deep, which means 72 dots by 24 dots.
I hope that gives you a lightbulb moment! I've had similar fun working with an LCD remote display device in the past.
Iain.
In the process of moving to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), give me a job!
|
|
|
|
|
Iain,
hmmm. I'll look into that, thanks. It certainly doesn't help matters when the documentation is written in "engrish", with no practical examples.
Regards,
Sternocera
|
|
|
|
|
I've been trying to work out a design problem with one of my pet projects. Essentially, it works on the process of Streams. A program will write to a Stream; this is an abstract class which multiple classes inherit from. For example, a program will write to a Stream, and this could write to either a file or the system console
This all works rather well so far, but one of my additions has made things difficult. This is the daisy-chaining of Streams. A Stream can forward its data onto another Stream. The problem is that this is rather easy to take advantage of. Currently, there's nothing stopping a Stream from forwarding its data to itself, causing a recursive loop. I'm not using Windows in any way, so there's nothing to stop the loop from continuing until the stack overflows into the text segment, rewriting the kernel's code. Is there any way to stop this from happening?
|
|
|
|
|
One way is to only allow daisy-chaining in stream constructors. Then, by definition, you can't daisy chain a stream to itself.
I believe .NET and the Java class library have that restriction on stream daisy-chaining.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
That sounds like it will work. As soon as I implement thread synchronisation, I'll do that. Just one more question though: how would I pass a WriteFormat call down to the chained Stream? I can't pass it in the normal way, because there's no parameter name. I have no va_arg definitions. I'm thinking of something like this:
LinkedStream->WriteFormat(fmt, *((uint *)&fmt + 1))
Would this have any side-effects (disregarding security)?
|
|
|
|
|
Computafreak wrote: I have no va_arg definitions
Why not? Is it a platform limitation?
If there's no other reason, then va_args could work.
Alternatively, you could use operator chaining as with Boost.Format[^]?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
It's quite a mixture. I'm developing an operating system, so haven't added most of the standard definitions. But based upon the #defines it appears to be doing pretty much the same thing as the code snippet I posted. Should it theoretically work? Thanks for the link though, I'm looking through it now; it should be helpful
|
|
|
|
|
Computafreak wrote: But based upon the #defines it appears to be doing pretty much the same thing as the code snippet I posted.
(Presuming you mean va_args) yes, it will be - it's all just stack hackery, which is more dependent on the compiler you're using and hte way it lays out parameters than the OS or anything else really.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
That really helps. I've still got one or two problems, but I'll work through those on my own. Thank you
|
|
|
|
|
I know it doesnt answer all your issues - but maybe you can glean something useful from this :- http://www.codeproject.com/KB/library/ssaxpipe.aspx
'g'
|
|
|
|
|
hiii..i am trying to implement huffman coding for compressing text files...here i have to write bits of variable length into a file...but i am not able to do so...please help...
|
|
|
|
|
krish_amrita wrote: please help...
That will be very difficul since you didn't provide any useful information... What is a bit of variable lenght ?
|
|
|
|
|
Hi,
that is not beginner's stuff.
I did it once, long ago; you need to come up with a way to represent bit strings of limited length.
Here is one way of doing it:
imagine a struct "BITPATTERN" containing:
- int value; // holding up to 32 bits (right-aligned)
- int signif; // holding how many bits of value are significant.
Now implement a CONCAT(BITPATTERN a, BITPATTERN b) function that appends b to a.
The easiest way is by implementing a for loop, iterating over all the bits of b by:
- left-shifting a.value
- incrementing a.signif
- testing one bit of b.value
- if that bit is non-zero incrementing a.value
In addition one has to deal with overflows, i.e. data is not allowed to get lost in a.value while
shifting; one approach is to test for a.signif==8 and store a.value somewhere (to a file), clear it, and reset a.signif inside the CONCAT loop.
Finally, when all concatenations are done, some data may be left in a.value; so some extra zero bits should be concatenated until a.signif becomes 8 and everything gets flushed out.
BTW: you could do similar things using strings containing "0" and "1"; that is slightly easier to code, but far worse as performance goes; and the highest-performance implementations would not have a loop over the significant bits in b, they would use table lookups.
PS: I would expect some implementations to be available on the internet (and a fraction of them to be correct); make Google your friend.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Does this[^] help?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
#pragma once
using namespace std::tr1::function;
template<class _Fty>
class CDelegate : public function<_Fty>
{
public:
explicit CDelegate()
{
this->_Reset();
}
CDelegate(const _Myt& _Right)
{
this->_Reset((const _Mybase&)_Right);
}
//How to write here?
//operator()(****) //many parameters
//{
// m_funcs[0](****); //many parameters
// m_funcs[1](****); //many parameters
//}
~CDelegate()
{
this->_Tidy();
}
protected:
function<_Fty> m_funcs[2];
//reference_wrapper
};
|
|
|
|
|
That's the 'perfect forwarding' problem[^], that will only be solved well with the introduction of rvalue references in C++0x.
I would suggest you take a look at the implementation of Boost.Signals[^] - that does exactly what you're trying to implement (by which I mean the delegate concept).
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|