|
You have misunderstood the code:
- The
UuDecodeLength and UuEncodeLength functions get the length of a string as parameter and return the required length of the correspondant decoded/encoded string. - The
UuDecode and UuEncode functions get three parameters: an output buffer, an input string and the length of the input string. They return the number of bytes written to the output buffer, and put on the output buffer the decoded/encoded version of the input string.
I tried this on my PC:
int main(int argc, char* argv[])
{
INT8U in = "12";
INT8U* out = (INT8U*)malloc(UuEncodeLength(2));
INT32U n = UuEncode(out, in, 2);
free(out);
}
|
|
|
|
|
Thanks now I understand the Code,
I've to translate the "out" (in my case byte-array) into ASCII (string-array), then it is working.
"12" =(UuEncoding)= ",3)"
thanks Sauro Viti for this dump...
|
|
|
|
|
May I suggest you actually read the comments above each of those functions. They provide a functional description of what each function does, and they make perfect sense to me.
|
|
|
|
|
Why in Video File -> Sample Grabber -> Null renderer chain setting sample grabber set one shot to FALSE results in IID_IMediaEvent->WaitForCompletion(INFINITE, &evCode) indefinite blocking after media control runs the graph and it needs to wait for copmletion before grabbing any frames?
With limited time interval it returns with 0x80004004 and evCode=0.
If set one shot is TRUE everything works correctly but it needs to run graph every time after a single grabbing.
Чесноков
|
|
|
|
|
hi
my custom window inserted in a CDockablePane object does not receive mouse click, while a button or a list box inserted in the same pane receives it. the pane is dragged when i click on the control instead.
what's the problem and how can i resove it?
thx
|
|
|
|
|
Please, do not post the same question on multiple forums: that doesn't increase your chances to get an answer but make people wasting their time answering the same things twice.
Thank you!
|
|
|
|
|
hi
apologize
i didn't mean that. i thought that i couldn't post the first one in a correct forum. so, i come here and posted in in C/C++/MFC forum.
|
|
|
|
|
Don't worry! My goal was not to blame you, but only to make you aware about cross-posting!
|
|
|
|
|
I'm not sure that it is the solution, but you can try to add the DS_CONTROL style to your window (see What is the DS_CONTROL style for?[^] for more informations).
You can do it from the Resource Editor: open your dialog and on its properties, set Control to TRUE .
|
|
|
|
|
the pane and the child window created in it are created dynamically, not loaded from a resource!
|
|
|
|
|
Is there good library that can do it ? Boost? other?
|
|
|
|
|
Do you mean an image on a web page that links to another page ?
If so you should look at the HTML DOM interfaces.
Start with IHTMLDocument2 .
|
|
|
|
|
thanks for your reply.
Yes, I want to get all the page link and image address in some web page in depth 5.
When use the Regular expression. I find that some error URLwill be got.
|
|
|
|
|
Create an HTML DOM object and use the IHTMLDocument2::write to load the HTML.
Now use IHTMLDocument2::get_images to get a collection of all the images in the web page.
Iterate through the collection to get the IHTMLElement interface for each image.
Now call IHTMLElement::getAttribute with SRC as the attribute name to get the source URL of the image.
Here is an article to help you with manipulating the HTML DOM - Capture an HTML document as an image[^]
|
|
|
|
|
|
Hi,
I am having trouble with VariantCopy() when the source variant is a VT_ARRAY. I have used VariantInit() and VariantClear() on the destination variant as suggested on MSDN but VariantCopy still does not work. It works OK with non-arrays but then thats easy. In the code fragmet below, pValue points to a VARIANT containing array data.
VariantInit(&m_value);
VariantClear(&m_value);
HRESULT hr = VariantCopy(&m_value, pValue);
if(FAILED(hr))
{
TRACE("Failed to copy variant\n");
}
I can't find any useful examples on MSDN. Anyone have any idea as to where I am going wrong?
Thanks
Tony
|
|
|
|
|
Its OK, I found the cause of the problem. All the time I was thinking that there was something wrong with the destination variant but in fact it was the source variant that was messed up. I had set the variant type to VT_ARRAY, but failed to say what type of array it was e.g. m_value.vt = VT_R8 | VT_ARRAY.
Tony
|
|
|
|
|
I'm trying to use the RegEnumValue function, but I can't get the correct values in the ValueName and data fields
Its seems that the enum itself is ok since its runs the correct number of loops and the sizes parameter are correct.
I get the same result again and again in the ValueName valuedata fields.
Thanks in advance for any help
here is the code I'm using
HKEY hKey = NULL;
LONG enumresult = 0;
WCHAR valuename[1024];
DWORD valuenamesize = 1024;
DWORD valuedatasize = 1024;
WCHAR valuedata[1024];
long index = 0;
const WCHAR* subkey = L"Software\\xxx";
if( RegOpenKey(HKEY_LOCAL_MACHINE, subkey ,&hKey) == ERROR_SUCCESS)
{
while( RegEnumValue(hKey, index++, valuename, valuenamesize, 0,
NULL, (LPBYTE)valuedata, valuedatasize) != ERROR_NO_MORE_ITEMS)
{
cou<
|
|
|
|
|
Are you sure this code works?
I'm asking because the valuenamesize is a pointer to a DWORD and you're simply passing a DWORD instead.
|
|
|
|
|
In addition to what Superman said, valunamesize is an in/out paramter, which means that it will be changed when the function completes.
You need to be sure to reset it to a proper value before each call (i.e. within your while loop).
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
Thanks, That was the problem, needed to reset the size parameters
|
|
|
|
|
Arnon A wrote: cou<<valuedata;< blockquote="">
Shouldn't this be wcout ?
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I have run into a very strange error today and was wondering if anyone else has seen this. Some digging on google suggests it might be a compiler error. I've seen this on VS2008 and GCC 4.1.2.
I was able to build a test harness to repro the issue. It is below:
<pre>
#include <iostream>
class Cloneable
{
public:
template<class TYPE> TYPE* clone() const { return dynamic_cast< TYPE* > ( clone() ); }
virtual Cloneable* clone() const = 0;
};
// simple template class that defines an interface
// for cloning objects.
class X : public Cloneable
{
public:
X(int _y ) : data(_y) { }
virtual ~X() { /* DO NOTHING */ }
virtual Cloneable* clone() const { return new X(data); }
protected:
X() { /* DO NOTHING */ }
int data;
};
class Y : public X
{
public:
Y(double f, int y) : X(y), dataf(f) { /* DO NOTHING */ }
virtual ~Y() { /* DO NOTHING */ }
virtual Cloneable* clone() const { return new Y(dataf, data); }
protected:
double dataf;
};
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
int main(int argc, char* argv[])
{
X* x = new X(1);
X* x1 = x->clone<X>();
Y* y = new Y(2.12, 4);
Y* y1 = y->clone<Y>();
delete y;
delete y1;
delete x;
delete x1;
return 0;
}
</pre>
The clone<TYPE> fails in both cases in the main function. It should cast properly. There seem to be two ways to fix this. If i move the templated function from Cloneable to X & Y it works in both cases. The other is to use clone() in the main function and dyna cast there.
A standard C cast in the templated function also doesn't work. Its like the compiler is erroneously changing the protection level on the function and then gets confused and just dumps out the error.
<pre>
1>Compiling...
1>main.cpp
1>.\main.cpp(40) : error C2275: 'X' : illegal use of this type as an expression
1> .\main.cpp(12) : see declaration of 'X'
1>.\main.cpp(40) : error C2059: syntax error : ')'
1>.\main.cpp(43) : error C2275: 'Y' : illegal use of this type as an expression
1> .\main.cpp(24) : see declaration of 'Y'
1>.\main.cpp(43) : error C2059: syntax error : ')'
</pre>
Anyone seen this work in a different compiler or know of a workaround to make it compile (aside from the ones I mentioned)?
--
Joseph Dempsey
Sr. Software Engineer
joseph_r_dempsey@yahoo.com
<div class="modified">modified on Friday, November 5, 2010 2:18 PM</div>
|
|
|
|
|
You're code is not fully visible.
Make sure "Encode < characters while pasting" option is checked while you paste your code.
|
|
|
|
|
It was already checked. It shows up fully in my browser (chrome) and in IE just fine. Not sure why you can't see it.
--
Joseph Dempsey
Sr. Software Engineer
joseph_r_dempsey@yahoo.com
|
|
|
|