|
Hi
I need to upload binary file (dll) to SQL Server database throught ADO.
I tried to use "ADODB.Stream" object, but i can't open this stream from the file.
hStream->Open(n, adModeUnknown, adOpenStreamUnspecified, _bstr_t(""), _bstr_t(""));
hStream->LoadFromFile(szFileName);
Could you specify correct syntax for this method call
Thanx.
|
|
|
|
|
Hi
I have one application that generates an Storage of ActiveXControls ( OleDocument -> Save Map-> ...), and I would like to read that storage and just put the ActiveXControls in a normal view, is there any way to do that ?
Thanks, Bye !
Braulio
|
|
|
|
|
HI ALL
I want make simple calculator so I get some problems like :
- try do that :
double d1 = 5/3 ; //same (5/3)
double d2 = 3/2 ;
and you get this result (1)
when you do that in Calculator program(by Microsft)
the result is (1.6666666666666666666666666666667) and (1.5)
the problem here the value after the point didn't appeare
I tried by VISUAL C++6 using (CEDIT box)
- next problem ,when you try to show larg number in (CEDIT box)
the CEDIT box show the number with (e+) like(8.98765431209876e+016)
how I can disable or enable this(e+)
THANK YOU
AHMAD ALWASHALI
|
|
|
|
|
> double d1 = 5/3 ;
The calculation 5/3 is done with integer values, so the result is 1. If you want a double result, convert the operands to double _before_ the calculation:
double d1 = 5.0/3.0;
|
|
|
|
|
Thank you very much
AHMAD ALWASHALI
|
|
|
|
|
HI ALL
pointer of pointer(char** ch)
some times I see this this(char** ch)
for example in (strtod) function
it's strang kind of pointer
can you tell me about this kind of pointer
THANK YOU
AHMAD ALWASHALI
|
|
|
|
|
What more can i say expept
that it's a pointer that points
to a pointer. 8-)
It's used -usually- when you want a function to
return a pointer through it's arguments.
void GetPointer(char** ppChar)
In that case you call the function by passing
the address of the pointer.
char MyChar='A';
char* pMyChar=&MyChar;
GetPointer(&pChar);
- - - - - - - - - - - - - - - - - -
Memory leaks is the price we pay \0
01234567890123456789012345678901234
|
|
|
|
|
Thank you very much
AHMAD ALWASHALI
|
|
|
|
|
HI ALL
My qustion about
bitwise left shift and sight shift Operators << , >>
I don't understand what it does,I searched in MSDN i found
that :
The bitwise shift operators shift their first
operand left (<<) or right (>>) by the number
of positions the second operand specifies.
and then give me this example :
// Example of the bitwise right shift operator
int nNumA=8; // beginning value is 8
nNumA >> 2; // ending value is 2
what this does the (nNumA) stil has the value (8)
Can you tell me what the << , >> do, and when I use it.
THANK YOU
AHMAD ALWASHALI
|
|
|
|
|
Ahmad
the bitwise operators move the bits in a variable left or right the number of positions requested. Take the following code snippet for example.
void main()
{
int nNumber = 8;
nNumber >> 2;
}
If you move the bits set to 1 too far to the left or right they just drop off the end and are lost.
Hope that helps.
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
Thank you very much
AHMAD ALWASHALI
|
|
|
|
|
i want to use my program to replace the windows logon dialog box on windows 98/nt/2000,who can tell me what should i do,especally on 98;P
|
|
|
|
|
Hi
I need to call a dos command in my program, which is a win32 console application. Does anyone know how?
Thanks
kk9
|
|
|
|
|
Try system("dir"); or system("command /k dir "); (or cmd for NT). The /k switch leaves the user at the command prompt until they type exit to return to your prog, so this acts as a sort of 'shell to DOS' command.
|
|
|
|
|
If I understand you correctly you wish to call a DOS command from your program without suspending the running of it or forcing a Command Prompt to appear for the running of any commands. If this is correct, you need to call the system function.
int system( const char *command );
Only problem with this is the fact it can only return an int to tell you if it worked or not and also any error that occurred via errno. If you wish to get access to the response of the DOS command you would I suppose have to pipe the DOS command to a file ie. [nRetVal = system("dir C:\Program Files > C:\Output1.txt")] and then parse the results from the file later in your program.
Hope this helps.
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
Question Summary: How do you customize the "tooltips" displayed by Intellisense?
Question Details:
I am trying to customize the "tooltips" that show up as a part of Microsoft's Intellisense "Auto Complete" feature.
For example, while building an ASP page in Visual InterDev, if I type "Request" and a dot (.), an Intellisense window "pops" up and displays the properties and methods that the ASP Request object supports. As I scroll down the list of available methods and properties, an "information" tooltip appears to the right of the drop down list.
I have been able to trace the content of these "information" tooltips back to the type library ASP.tlb. The same "information" string appears in the helpstring attribute. It would seem that this is the source of the text that Intellisense uses. (If this observation is incorrect, please let me know)
When I created a test component, I put my own detailed help "information" string in the helpstring attribute. However, when I do this it does not show up like it does for Microsoft's intrinsic ASP objects. In fact, it does not show up at all.
What am I doing wrong? Why is Microsoft able to do this and I am not? Is there a different IDL attribute to set, or perhaps a different IDL compiler is required?
Thanks in advance for any advice or recommendations. If anyone knows of good documentation of Microsoft's Intellisense, that would be great too.
Sincerely,
Trong Ha
|
|
|
|
|
I only have experience with C++ so I do not know if this would apply to ASP...
Intellisense uses comments located around the source code. E.g.
class Foo
{
// Method description
int Func();
int _value; // Variable description
};
void main()
{
Foo f;
f.// Intellisense pops up now
}
Once the period is typed Intellisense comes up. When you highlight "Func" it will display "Method description" from the comment above the method declaration (it removes the //). Same thing for a variable. If it doesn't find a comment above the declaration it looks after it.
I have noticed sometimes it works right after I #include the file; sometimes it will not work until a close and re-open the project. I've also noticed that it does not always work with COM interfaces.
I don't know if any of this relates to ASP but I thought I would share my experience with Intellisense in case it does.
|
|
|
|
|
I'm doing a programatic install of device drivers in NT, but before I do it, I would like to make sure the user has permissions to do so (and fail gracefully if they don't).
I'm looking at NetUserGetInfo() but it doesn't appear to be behaving as expected.
Some additional details:
Look up rights from the local machine first
look up rights from the domain controller (of the primary domain)
If they have admin rights, groovy. If not, die (which I can do )
Does anyone have some sample code that I can use?
Thanks!!
--Dave Weber
|
|
|
|
|
Found this in "Taking Object Ownership" in the MSDN:
HANDLE hToken;
if (!OpenProcessToken( GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES, &hToken) {
printf("OpenProcessToken failed: %u\n", GetLastError() );
return FALSE;
}
if (! SetPrivilege(hToken, SE_TAKE_OWNERSHIP_NAME, TRUE) ) {
printf("You must be logged on as Administrator\n");
return FALSE;
}
Might be other ways, but this seems kind of short and sweet
|
|
|
|
|
It works! Thanks!
It's not short though. You have to define SetPrivilege(...)
It's in MSDN "Taking Object Ownership"
BOOL SetPrivilege(
HANDLE hToken, // access token handle
LPCTSTR lpszPrivilege, // name of privilege to enable/disable
BOOL bEnablePrivilege // to enable or disable privilege
)
{
TOKEN_PRIVILEGES tp;
LUID luid;
if ( !LookupPrivilegeValue(
NULL, // lookup privilege on local system
lpszPrivilege, // privilege to lookup
&luid ) )
{ // receives LUID of privilege
printf("LookupPrivilegeValue error: %u\n", GetLastError() );
return FALSE;
}
tp.PrivilegeCount = 1;
tp.Privileges[0].Luid = luid;
if (bEnablePrivilege)
tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
else
tp.Privileges[0].Attributes = 0;
// Enable the privilege or disable all privileges.
AdjustTokenPrivileges(
hToken,
FALSE,
&tp,
sizeof(TOKEN_PRIVILEGES),
(PTOKEN_PRIVILEGES) NULL,
(PDWORD) NULL);
// Call GetLastError to determine whether the function succeeded.
if (GetLastError() != ERROR_SUCCESS)
{
printf("AdjustTokenPrivileges failed: %u\n", GetLastError() );
return FALSE;
}
return TRUE;
}
It's a common enough thing to have to do. I'm sure there must be some built in function somewhere.
|
|
|
|
|
I am having trouble recasting a void pointer - can someone please help me.
My code looks like this:
void* structure = NULL;
...
structure = (CWPSTRUCT*) lParam;
hwnd = structure->hwnd;
when I compile, I get this error:
error C2227: left of '->hwnd' must point to class/struct/union
I am a bit confused as CWPSTRUCT is a structure and the error is not generated on the line where the casting is done.
Thanks,
Andrew
Andrew Traub
CompuFlash, Inc.
http://www.compuflash.com
|
|
|
|
|
You need to do this:
CWPSTRUCT * structure = NULL;
...
structure = reinterpret_cast<CWPSTRUCT *>(lparam);
hwnd = structure->hwnd;
The problem was that you told the compiler that structure was a void pointer, not a pointer to CWPSTRUCT, when you declared it.
He was allying himself to science, for what was science but the absence of prejudice backed by the presence of money? --- Henry James, The Golden Bowl
|
|
|
|
|
I havent programmed so much before, and I wonder how I can switch between two forms in a window. I am using visual c++ 6.0. My goal is that when I push a button one form is going to appear, and when I push annother button the other form is appearing. If anyone can help me I would be grateful.
|
|
|
|
|
Hi
I would like to grey out an item in the Tree of Outbarcontrol.
Pl let me know how to proceed.
Karthik
|
|
|
|
|
I created a small browser with Internet Explorer Component, and i'd like to use proxy like IE do, but i don't know how??
Help!!
|
|
|
|