|
Yes,but then its about the speeds, how much slower would it be to use names to look up the objects then numbers?
|
|
|
|
|
How long is the filename? Count bytes.
Kuphryn
|
|
|
|
|
The name in the string should be about 10 - 20 bytes...
|
|
|
|
|
Adding 160 elements
Add: 0 Millisecs
Starting iteration: 2000000 times.
GetByName: 58895 Millisecs
GetByPos: 4457 Millisecs
This is timings with about 25 char std::strings ... i havent optimized it much.
And using a std::vector ... damn thats alot of time! .. its timed using GetTickCount() just for the record
And btw, the time did not change if i changed the string to 1 char from 25.
The string comparation is only if(*it != Name) so far...
|
|
|
|
|
How about writing an index file?
|
|
|
|
|
Dear ALL,
I am working a program to block a physical disk (removable disk, eg c: )so that it should be inaccessible from user mode.
For hiding the disk I modified Registry settings:
1)
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NODRIVES which is a 32-bit word (DWORD).
========
if i hide c: by changing above settings , the drive is hidden but i can still access it from address bar or command prompt. Is there any way to block the drive completely ??
Waiting for a positive response.
Rohit
--------Complete solution for hiding drive------
change the registry value HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies
\Explorer\NODRIVES which is a 32-bit word (DWORD). The lower 26 bits of the 32-bit word correspond to drive letters A through Z. Drives are visible when set to 0 and hidden when set to 1.
Drive A is represented by the rightmost position of the bitmask when viewed in binary mode.
e.g. A bitmask of 00000000000000000000010101(0x7h)
The bitmask above hides local drives A, C, and E
---------------------------------------
|
|
|
|
|
hai rohit even i am facing the same problem ,we can still acess the drives from the command prompt.
try seeing "Browser Helper Objects: The Browser the Way You Want It" in MSDN this may help u
can u share the solution with me once u grt it thx.
qrious
|
|
|
|
|
Hi I want to send data using POST method. I use CAmHttpSocket, everything works fine, but generally how to set a timeout in case the server doesn't respond.
Please help
|
|
|
|
|
I'm not sure what CAmHttpSocket is but I think what you are looking for is CInternetSession::SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, ...).
|
|
|
|
|
i'll be extremely gratefull to the people who try to help me .
My question is regarding the use of icm 2 api and is listed below
i am trying to find colors that are out of printer gamut using icm 2.0
using the following code
/*Getting color profile handles*/
HPROFILE hICMMonitorProfile
=OpenColorProfile(&input_profile_struc,
PROFILE_READ,FILE_SHARE_READ, OPEN_EXISTING);
HPROFILE hICMOutPutProfile
=OpenColorProfile(&output_profile_struc,
PROFILE_READ,FILE_SHARE_READ, OPEN_EXISTING);
if (hICMMonitorProfile == NULL||hICMOutPutProfile ==
NULL)
{
AfxMessageBox("OpenColorProfile() failed");
}
///////////////////////////////////////////////////////////////////////
/
///
/*Creating color transform*/
LOGCOLORSPACE lcs = {
LCS_SIGNATURE, 0x400,
sizeof(LOGCOLORSPACE)
};
lcs.lcsCSType = LCS_WINDOWS_COLOR_SPACE;
lcs.lcsIntent = LCS_GM_GRAPHICS;
m_hICMColorTransform =CreateColorTransform(&lcs,
hICMMonitorProfile,hICMOutPutProfile,ENABLE_GAMUT_
CHECKING|INTENT_RELAT
I
VE_COLORIMETRIC);
if (m_hICMColorTransform == NULL)
{
AfxMessageBox("ICM CreateColorTransform() failed");
}
/*checking RGB colors ,if they out of printer gamut ,
using code as
follows*/
//getting RGB color values from sliders
ICMInColor.rgb.red=m_R.GetPos();
ICMInColor.rgb.green=m_G.GetPos();
ICMInColor.rgb.blue=m_B.GetPos();
BYTE bytearray[1];
bytearray[0]=0;
CheckColors(m_hICMColorTransform,&ICMInColor,1,COLOR_RGB,bytearray);
if(bytearray[0]!=0)
{
//the color is now of of gamut
//according to my perception
}
this code never shows any value as out of gamut however when i use that
same profiles in photoshop ,the results are far away...different from it can anyone please help me ,solve this problem and also tell me any forums relating to icm discussion
ahmed
|
|
|
|
|
hai,
Can any body help where from i can get flash api to use in my program. I don't want to use control to play the flash file, i want to use some API calls to send it to simulate it one the view.
suresh
|
|
|
|
|
Hi everyone,
I have a C++ dll that has a few function interfaces to VB. Now, I need to pass a C++ class pointer to VB that they should be able to use or pass to another C++ dll.
Is it possible that I can pass the class pointer as a long value and they can cast it later or something.
I am really confused about this and some suggestion or even a small code snippet would be greatly appreciated.
Best regards,
Pankaj
P.S: it is not an ATL DLL.
Without struggle, there is no progress
|
|
|
|
|
That should work.
Jason Henderson My articles
"The best argument against democracy is a five-minute conversation with the average voter." - Winston Churchill
|
|
|
|
|
Ok, I have the following function definition in C++:
long _stdcall GetInstance_()
{
return (long)pCtrl;
}
Now after I get this long value in VB. How can I cast it back to the object? Does VB even know about the original object?
Thanks,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
VB isn't going to be able to use a C++ class pointer, but you can pass it to another C++ app or dll for use.
Jason Henderson My articles
"The best argument against democracy is a five-minute conversation with the average voter." - Winston Churchill
|
|
|
|
|
Hi again,
Even if the other app does not know about this class? Does it need the header file or do I need to export this class in some way. If it is not too much hassle, can you post a small code snippet that I can use as a guideline?
Thanks,
Pankaj
Without struggle, there is no progress
|
|
|
|
|
Just think about it.
How could another app use a c++ class when it is not defined in that other app. If you include the header, it should work.
I don't have a code snippet handy.
Jason Henderson My articles
"The best argument against democracy is a five-minute conversation with the average voter." - Winston Churchill
|
|
|
|
|
Yeah,
I was wondering if linking the lib file would be of any help.
Pankaj
Without struggle, there is no progress
|
|
|
|
|
I can't seem to map my accelerator keys to my dialog.
I have mapped the Accelerator 'Alt + 1' to my Dialog class but the functions are not being called?
If I map the accelerator keys to my MainFrame (to try to forward them to my Dialog) then the functions are not called when the dialog box is displayed.
No matter what I do I cannot seem to use accelerator keys when a dialog box is being displayed.
I know I'm doing something stupid becuase I've seen this functionality before.
Any ideas?
Cheers
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
I should just RTFM before I start posting shouldn't I.
Figured it out from here:
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q222/8/29.ASP&NoWebContent=1
Asim Hussain
e: asim@jawache.net
w: www.jawache.net
|
|
|
|
|
How to write an application to send email.
I have:
FROM_email_address.
TO_email_address.
Subject, body of mail.
After a click on the button, the content will be send.
|
|
|
|
|
|
hope that i can complete and post an article shortly.
[ It is possible to represent everything in this universe by using 0 and 1 ]
|
|
|
|
|
HI ALL
I want that every memory allocation will be tracked...
is there a way for me to overwrite the new and delete functions...
this and every other solution will be appreciated gracefully.
Objective: Tracking Memory Allocations
Thank you all...
-==--==--==--==--==--==-
=--= The Server =--=
-==--==--==--==--==--==-
|
|
|
|
|
The_Server wrote:
is there a way for me to overwrite the new and delete functions...
I'm assuming you meant to say overload , because new and delete are not functions; they are operators. In that case, no- these operators CANNOT be overloaded.
[EDIT]Red alert! Red alert! I made a horrifying mistake. Both new and delete can be overloaded. See all posts below.[/EDIT]
Regards,
Vikram.
-----------------------------
My site due for a massive update
1. Don't ask unnecessary questions. You know what I mean?
2. Avoid redundancy at all costs.
3. Avoid redundancy at all costs.
"Do not give redundant error messages again and again." - A classmate of mine, while giving a class talk on error detection in compiler design.
|
|
|
|