|
Any suggestion here ? Is there any anti-aliasing method for the video playback ?
sdancer75
|
|
|
|
|
Solved ! VMR9 under vista and later OS does not support interpolation. Microsoft removed this functionality to enforce programmers to use the new EVR renderer.
Shity thoughts from a company like MS!
sdancer75
|
|
|
|
|
Hi to all, I am writing a program which will copy a directory tree and delete the source, every thing works as planned, but given that a reparse point could point anywhere (even network drives), one need to be careful when deleting recursively, it could end up deleting way more than on a target system.
How to deal with this situation when dealing with FILE_ATTRIBUTE_REPARSE_POINT, whether it is a recursive copy routine or delete routine.
Regards,
Vishal
|
|
|
|
|
|
|
vishalgpt wrote: I am writing a program which will copy a directory tree and delete the source
Do you have an actual business case for this?
vishalgpt wrote: How to deal with this situation when dealing with FILE_ATTRIBUTE_REPARSE_POINT
Depends on your business case but one very obvious and easy solution involves the following steps.
- Stop
- Report an error.
Some more complex solutions would be to span the tree before starting and refuse to continue if any problems are found.
Just curious what is your application going to do if the the files/directories are in use when you are deleting (which is probably much more likely than what you are asking.)
|
|
|
|
|
Been told by gurus that this is legal. It does compile in VC.
But since when?
It makes no sense to me. SO how big is the memory footprint?
Thanks for your time.
long unsigned int foo;
|
|
|
|
|
I've read that the position of the word unsigned isn't important, though I'm not sure if this is an addition made over the years, or if it has been a part of c (&c++) since day 0.
sizeof(long) and sizeof(int) are both the same on a 32 bit system - 4. If memory serves me correctly, in the old days of my experience with 16-Bit turbo C++ 3.1, a long was 4 bytes long and an int was 2 bytes. Not sure if the sizeof operator returns the largest of the two or something else. sizeof(long long) for instance, is 8. So, I don't know if long int is a type in and of itself, as long long is, or if its seen as being a long modification of the int data type.
The StackOverflow community generally have someone online with the c/c++ specs seemingly committed to memory.
Interesting question.
|
|
|
|
|
I just tried this:
long long unsigned int llui;
unsigned int ui;
unsigned long ul;
cout << "long long unsigned int: " << sizeof(llui) << endl;
cout << " unsigned int: " << sizeof(ui) << endl;
cout << " unsigned long: " << sizeof(ul) << endl;
resulting in:
long long unsigned int: 8
unsigned int: 4
unsigned long: 4
It appears that the compiler accepts all specifications and creates the largest item. The results are the same whether unsigned or not.
Veni, vidi, abiit domum
|
|
|
|
|
Why do you think it is a nonsense?
long is a shortcut for long int , (like short for short int ).
unsigned is a legal attribute and foo is a noble choice for a variable name.
You may also find it here: "Data Type Ranges" at MSDN[^].
Veni, vidi, vici.
|
|
|
|
|
Because the "unsigned" should be the first specification. We do not write "int unsigned", so why is "long unsigned int" OK?
|
|
|
|
|
Vaclav_Sal wrote: We do not write "int unsigned", so why is "long unsigned int" OK?
We do, actually (at least we can do) (MSDN[^]):
The optional keywords signed and unsigned can precede or follow any of the integral types, except enum, and can also be used alone as type specifiers, in which case they are understood as signed int and unsigned int, respectively. When used alone, the keyword int is assumed to be signed. When used alone, the keywords long and short are understood as long int and short int.
Veni, vidi, vici.
|
|
|
|
|
Hello everybody, I'm new in this forum. I don't know where to place this thread, because it's about VB6 and C, but I think the problem is in the C code so here I am. I'm working with C with no special focus, so the solution can be in C++ too
Well, this is the problem. I have a VB6 program that simply calls a function when the Command1 is pressed. This one:
Public Function SampleSub(ByVal x As Integer, ByVal y As Integer) As Boolean
MsgBox "Hello world!"
SampleSub = True
End Function
I'm trying to call it from C like this:
#include "main.h"
typedef BOOL (__stdcall *SampleSubPtr)(WORD, WORD);
static SampleSubPtr SampleSub;
DLL_EXPORT BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
BOOL ret;
if (fdwReason == DLL_PROCESS_ATTACH)
{
SampleSub = (SampleSubPtr)(0x00401B90);
if (SampleSub == NULL)
MessageBox(0, "SampleSub is NULL.", "M", 0);
ret = SampleSub(5, 5);
}
return TRUE;
}
0x00401B90 is the pointer to the VB6 function. Then I place this DLL into the VB6 program memory space and the function is called. But it simply doesn't work. Debugging this with OllyDbg gives me this error when calling the function:
Access violation when reading [00000076]
I'm 100% sure that the function is at the address 0x00401B90 . VB6 uses __stdcall and I use __stdcall from C. VB6 uses 16-bit integers and I use 16-bit integers (WORD ) from C.
I can't solve this. Any ideas?
Thanks in advance!
|
|
|
|
|
Is the SampleSub() function in a DLL?
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Hello. Thanks for the answer. No, the SampleSub() function is inside a VB6 program, an executable. Then I build a C DLL with the code above and inject it on the VB6 process. Sorry if I don't explain that very well.
Thanks again.
|
|
|
|
|
How are you determining the address of the VB6 function?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi, thanks for your answer. I'm using:
AddressOf SampleSub
Also OllyDbg gives me that address.
|
|
|
|
|
I would experiment with calling other VB6 functions to see if they give the same result. Especially try calling a function that takes no parameters to see if the problem might be the parameter passing.
Have you ever had success calling a VB6 function from C?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
|
I'm afraid I don't know what it could be. However, I had always believed that it was not possible to arbitrarily call into a VB6 executable.
I was under the impression that the old VB worked on a, sort of, virtual execution scheme, and the VB program was under the control of a supervisor thread.
I wish I could be more helpful!
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Ok thank you very much, I'll keep trying and tell you if I could make the trick. If anybody have any idea please tell me!!
Thanks again!
|
|
|
|
|
|
Hi Randor, thank you very much for your reply. I'm actually just using a VB6 "function" with no return value and that takes no parameters. This one:
Public Sub SampleSub()
MsgBox "Hello world!"
End Sub
With the typedef void (__stdcall *SampleSubPtr)(void); prototype. What should I use instead of void ? I think it will be better to start calling a simple function with no parameters, that's why I delete the old function that returns a VB boolean and takes two Integers as it params. I checked out the link your provided but that's for a Variant type in VB6, do you mean I should use VARIANT in C++ for any VB6 type?
I was thinking... I always get the Access violation when reading... error, do you think that a type incompatibility can cause this?
What would you do in my place? This problem is driving me crazy!
Thanks again!
|
|
|
|
|
hi all,
please guide me and provide me a right direction.
currently I m using office automation and random password generation for this but is to time taking and slow process.
please help me to start for ms office file password recovery type application?
thanks in advance.
|
|
|
|
|
Le@rner wrote: please guide me and provide me a right direction. Learn how to do basic research[^].
Veni, vidi, abiit domum
|
|
|
|