|
Check out http://www.codeproject.com/listctrl/listview.asp for a good intro to Listviews under Win32 API using C.
|
|
|
|
|
how to get hash from BYTE *pass to HCRYPTHASH hHash using
CryptCreateHash and CryptHashData
//in this program hash doesn't change =(
HCRYPTPROV hCryptProv;
CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, 0);
HCRYPTHASH hHash;
CryptCreateHash(hCryptProv,CALG_MD5, 0, 0, &hHash);
CryptHashData(hHash,pass,strlen(fPass)+1,0);
|
|
|
|
|
You're just missing the final step.
1. Get a CSP handle - CryptAcquireContext()
2. Create a hash object and specify hash algorithm - CryptCreateHash()
3. Add data to hash - CryptHashData() or CryptHashSessionKey()
4. Keep doing 3 until added all data
5. Finish hash and get result :
::CryptGetHashParam(hnd, HP_HASHVAL, BUFF, &BUFFLEN, 0); // BUFF is hash value
or,
::CryptSignHash(hnd, T, NULL, F, BUFF, &BUFFLEN); // BUFF is result signature
or,
::CryptVerifySignature(hnd, BUFF, BUFFLEN, pub, NULL, F); // BUFF is signature to verify
Each of these functions will finish the hash (i.e. add any algorithm required padding), meaning that any subsequent calls to CryptHashData() or CryptHashSessionKey() will fail. However, you can call any of these 3 multiple times safely, the hash is only 'finished' (padded) once.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Does anybody know how to draw the background for toolbars and rebars so that they match the currently selected XP colour scheme (blue, olive or silver). Th latest version of Office implements this so I assume it is possible to retrieve the background details via some API. The visual styles help in MSDN is very brief so any help you can give will be appreciated.
Steve.
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
|
Actually, I don't think Office uses a 'public' API for this. If you run Office 2003 on Win2K you still get the same visual effects, even though Win2K doesn't support those effects itself.
Software Zen: delete this;
|
|
|
|
|
|
How can I use C++ Dll that contains class in Delpphi&& Help!! SOS!!
|
|
|
|
|
Short answer: not possible cos delphi cannot use C++ obj/lib/dll files.
in anycase, u cannot use the dll with a c++ if u dont have the lib file. i believe though there are some tools that can create a lib file from a dll (msvc++ has one i think)
Bikram Singh
|
|
|
|
|
>> delphi cannot use C++ obj/lib/dll files.
That is not entirely accurate.
They cannot use each others classes but they can access C calling convention exported functions from DLL’s.
So the long answer is you would have to un-object orient the C++ class in a C++ DLL by exposing the functionality through a set of C style functions. Then the Delphi application can call the functions in the C++ DLL.
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
Hi,
I need to implement Span tag with style (overline etc) in vc++ can body help me out plz...
Helping hands are greater than Praying lips
lokesh
|
|
|
|
|
Hi
I want to set span tag with style(overline etc) and all to a text how do i do it? Thanx in advance
lokhes
|
|
|
|
|
|
I wrote an Active X control in Visual C++ using only ATL (no MFC), for use on a web page. When the control ends, it needs to go to another web page within the SAME IE browser window.
I am currently using:
ShellExecute(NULL,"open",NewPage,NULL,NULL,SW_SHOW)
to do this.
The problem is that this opens the new web page (whose URL is NewPage) in the default Browser, which isn't always always IE (it might be Netscape for example). It also opens a new IE window if the user has unselected "Reuse windows for launching shortcuts" in their IE Internet options. The most common problem, however, is that it opens a new "tab" in "Slimbrowser" and other "tab" based browsers.
The only solution seems to be to get a "IServiceProvider" pointer to the current browser window, then I can do a "IServiceProvider::QueryService" to get a "IWebBrowser2" pointer, and then use "IWebBrowser2::Navigate" to go to the new URL in the same window. This technique is described here: http://msdn.microsoft.com/msdnmag/issues/01/06/c/
However, I can't for the life of me figure out how to get the "IServiceProvider" pointer. In the above mentioned article, they said they got the pointer from the "Active Accessibility SDK", but not how. Also, I would prefer not to have to use this SDK.
I'm sure there is an easier way to do this. Remember that I can't use MFC!
Thanks in advance for any help you can give me!
|
|
|
|
|
|
hi !
I was testing out skinmagic demo for one of my apps,and came accross a few problems ..maybe experienced users can help me out on this.
problem 1 :
when i used irregular shaped dialog windows, the edges showed up as having a faint magenta lines ( i used magenta as my transparent color ).I made the image using photoshop 24 bit bmp,without any drop shadow.Can anyone tell me how to get rid of these edges?in the examples i saw dialog boxes with more complicated edges than mine but those didn't have a problem, and i am unable to find out the reason for this.Can anyone exolain why this happens ?
problem 2: i had a pulldown menu in my app, and when i skin it , the pulldown menu dissapears ! the popup menu (right click ) stays though...i mean it;s properly invoked on right click, but not the pulldown menu.
problem 3: As i said before i am using an irregular shaped dialog box in my main window.after skinning , the messageboxes are also assuming the same shape, which i do not one.i want my mnessageboxes to be plainer.Would specifying a control ID for the framedialog or the shapedialog help ?How can use a diff shape for my messagebox than my other dialog boxes?
I would be glad if anyone can solve my doubts.Thanks to all the contributirs in advance
Regards
Kane
"Some guys hack just to get themselves a girlfriend.What a pathetic reason, huh ?"
|
|
|
|
|
hello
without using any MFC classes ,
I want to convert a 24 bit color bitmap image to grayscale image.
How to do that ?
Can anybody give me simple code snippets to implement the logic?
|
|
|
|
|
Have you checked this
CP article[^]?
It uses MFC, but you should be able to rewrite it without problems.
Igor Green
http://www.grigsoft.com/ - files and folders comparison tools
|
|
|
|
|
// From www.OpenGL.org - 'Avoiding 16 Common OpenGL Pitfalls' by Mark J. Kilgard
// 'A standard linear weighting for combining red, green, and blue into luminance
// was defined by the National Television Standard Committee (NTSC) when the US
// color television format was standardized. These weightings are based on the
// human eye's sensitivity to different wavelengths of visible light and are
// based on extensive research. To set up OpenGL to convert RGB to luminance
// according to the NTSC standard, you would change OpenGL's default pixel
// transfer state like this:
// glPixelTransferf(GL_RED_SCALE, 0.299);
// glPixelTransferf(GL_GREEN_SCALE, 0.587);
// glPixelTransferf(GL_BLUE_SCALE, 0.114);
//
// From : Postscript Language Ref. Man. 2nd Ed. 6.2.1 pg.304
// '... NTSC viseo standard. This standard determines how a color
// television signal is rendered on a black and white television.'
//
byte b = (byte)(
(R * 0.299) +
(G * 0.587) +
(B * 0.114)
);
e.g.
Given : R = 120, G = 100, B = 200
Grey value = 120*.299 + 100*.587 + 200*.114 = 117.38 (117)
Grey color : R = 117, G = 117, B = 117
...cmk
Save the whales - collect the whole set
|
|
|
|
|
hi , How to access controls of a CFormview class from another CFormview class?
Aparna
|
|
|
|
|
You just don't. You trigger an UpdateAllViews from the document managing both views. If they don't have the same document, you should rethink your architecture both one and two times.
|
|
|
|
|
Aparna,
Have you managed to find a solution for this? I am stuck with this also...
thanks
|
|
|
|
|
Hi there,
I created a checklist which is itself a child view. The items on the checklist have corresponding buttons that allow the user to click on to perform the functions needed to complete the list. Once the user clicks on the button, a dialog box or form view appears. After the user clicks on the OK button to close the function view, how can I reference the checklist image in the checklist view to make it visible? Or should I say how do I refresh the checklist to see that the item has been completed? This is what I have so far:
void CCCheckList::OnSelFruits()
{
//opens up the Select Fruits dialog box
}
void CFruits::OnOk()
{
//do some things
PostMessage(WM_COMMAND, ID_FILE_CLOSE)
}
Where and how do I make the IDC_CHECKMARK image from the Checklist class visible?
Thanks!
|
|
|
|
|
Are any of the following ways of allocating memory faster or more efficient than the others:
malloc, calloc, free
c++ new, delete
LocalAlloc, LocalFree
GlobalAlloc, GlobalFree
CoTaskMemAlloc, CoTaskMemFree
-thanks
|
|
|
|
|
Stick with 'new' and 'delete', unless you have any specific requirements to use the other methods.
|
|
|
|