|
hi all,
I am trying to open the word file in My ActiveX control, for which Internet Explorer is a Container. I am using OLE apis eg:OleLoad().
When i exectute the sample HTML the IE shows two window one for my activeX control(always on top) and behind that the Word Window, with file opened. (for testing i have hard coded the path to word file)
I don;t want like this, i want the word should be open in the My ActiveX control, How do I acheive the same.?
I guess these is because I am passing the wrong IOleClientsite pointer in OLELoad() function.
Thanks in Advance
Abhishake
|
|
|
|
|
I got an application running on a client with low privilege. The application shall execute another program that needs administrator privilege to work appropriate. Is it possible to logon a privileged user with the LogonUser() function and then make a cal to CreateProcessAsUser() to execute the program with enough privilege? Do I also have to make a cal to LoadUserProfile(), and/or ImpersonateLoggedOnUser() before calling CreateProcessAsUser()??? Do I have to load any desktop or window station or some of that stuff?
I have done lots of reading on MSDN and coding, but with no result.
Is there somebody that can help me with this?
Rickard Israelsson
|
|
|
|
|
LogonUser in Windows 2000 requires that you have the Trusted Computing Base privilege, which by default means that only processes running as LocalSystem (also shown as SYSTEM) get to call it.
Windows XP and Server 2003 no longer require this privilege; however, you still need privileges typically only granted to Administrators and to SYSTEM in order to call CreateProcessAsUser .
Instead, I suggest using CreateProcessWithLogonW . This function communicates with the RunAs service, which has the necessary privileges. The command line runas tool is effectively just a wrapper around CreateProcessWithLogonW .
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hello everybody,
I inserted a static control into dialog box in dialog editor. I set it's styles to: Border, Center vertical. But when I run program or tested dialog by Layout -> Test command, the static displayed with border and sunken styles (that mean, it include WS_BORDER and SS_SUNKEN styles thought I did not).
I am using Visual C++ 6 SP5.
Why that? How can I fix it?
Thanks for reading.
|
|
|
|
|
What you are seeing is the 3D effect, not the SS_SUNKEN style.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Yes, But how can I remove that effect?
Thanks
|
|
|
|
|
Don't call Enable3dControls() (or Enable3dControlsStatic() ).
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
no,the style is still center vetical and border,border and sunken are different ,you can try to compare their effect,you only feel it look like sunken .
|
|
|
|
|
How can I consume a managed dll such as a dll that created by C# in unmanaged code like a MFC project?
|
|
|
|
|
|
I have matrixes having great array size.
i.e. float A[1000][1000][10];
Is it possible to open such a great matrix and how? Also, I would be pleased to know the maximum possible array size in C++ Builder. Thanks in advance to those who help?
|
|
|
|
|
Is it possible? Try it
The max possible size depends not on the compiler but on your stack size settings.
If it is not possible to create an array like this on the stack you can create it on ther heap. That should work...
Jens
|
|
|
|
|
Thanks Jen for the prompt reply.
However, if you could write a command line to open this size matrix on heap that would solve my problem completely. Looking forward to hearing from you.
Thanks.
|
|
|
|
|
Solution 1:
float *pfA = new float[ 1000 * 1000 * 10];
Solution 2:
typedef float floatArray[ 1000 ][ 1000 ];
floatArray *pfloatArray = new floatArray[ 10];
Solution 3:
typedef float ThausendArray[ 1000 ];
typedef ThausendArray Alot[ 1000 ];
Alot *pfA1 = new Alot[ 10 ];
Jens
|
|
|
|
|
Thanks a lot Jens
|
|
|
|
|
zaferaslan wrote:
i.e. float A[1000][1000][10];
That's 10 million float s on the stack. Unless you increase the default size of the stack from 1MB, it will not work. Use the heap instead.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Thanks David.
As I understand, I should use pointer type variable as Jens kindly proposed;
float *p= new float [1000*1000*100];
and also,
typedef float ThausendArray[ 1000 ];
typedef ThausendArray Alot[ 1000 ];
Alot *pfA1 = new Alot[ 10 ];
However, is there any other way? I need the variable in three dimensional array form and this approach generally causes lose of data during long executions.
|
|
|
|
|
zaferaslan wrote:
As I understand, I should use pointer type variable as Jens kindly proposed;
float *p= new float [1000*1000*100];
Yes, that's the ticket. The problem here is that it requires you to convert the three indices by proper scaling, e.g., to access the i, j, k element of the array, the subscript is
i + j * 1000 + k * 1000 * 100 or some variant on the above. You can't access it as pArray[i][j][k] .
zaferaslan wrote:
However, is there any other way?
Yes. Try:
int * * * p = new int**[FirstDimension];
for(int i = 0; i < FirstDimension; i++)
{
p[i] = new int *[SecondDimension];
for(int j = 0; j < SecondDimension; j++)
{
p[i][j] = new int[ThirdDimension];
for(int k = 0; k < ThirdDimension; k++)
p[i][j][k] = 0;
}
} zaferaslan wrote:
I need the variable in three dimensional array form and this approach generally causes lose of data during long executions.
You shouldn't be losing data. If so, something else is wrong.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Thank you very much David.
|
|
|
|
|
Why don't you use a vector instead?
<br />
std::vector< std::vector< std::vector< float > > > FloatMatrix;<br />
This way, you can avoid memmory allocation/deallocation and their associated problems and pitfalls...
A student knows little about a lot.
A professor knows a lot about little.
I know everything about nothing.
|
|
|
|
|
Thanks Bob. As I understand, FloatMatrix is defined as a 3-D vector here. Further, how can I add dimension sizes? And, therafter, could I be able to input data into the vector by classical functions such that scanf(), fscanf(), cin>>? Thanks in advance.
|
|
|
|
|
Hi,
Since vector is dynamic, you don't need to specify dimension sizes. If you need to reserve space you can use the function vector::reserve(). I don't know how you can specify the maximum size.
When you want to add values to the vectors through scanf and similar functions you can do it like this:
<br />
float f = 0.0;
<br />
scanf("%f", &f);
<br />
FloatMatrix[x][y].push(f);<br />
for reading from the vector:
<br />
float f = FloatMatrix[x][y][z];
if you look in MSDN for information on vector, you'll find more usefull information.
Good luck.
|
|
|
|
|
I will try it. Thanks a lot.
|
|
|
|
|
how to use CCryptMD5Hash??
|
|
|
|
|