|
www.microsoft.com/data[^] has the necessary downloads. Look for Jet4 SP3 in 'Downloads' section.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
I'm trying to send in a CTreeCtrl into a dialog member function from CMainFrame. I get an error back saying:
cannot convert parameter 1 from 'class CTreeCtrl' to 'class CTreeCtrl'
No copy constructor available for class 'CTreeCtrl'
In addition to my dialog class and MainFrm.h, I have the following included:
#include <windows.h>
#include <afxwin.h>
#include <afxcmn.h>
My prototype seems to match the function implementation. Any clues?
Thanks
BW
{insert witty/thought-provoking saying here}
|
|
|
|
|
try passing a pointer or reference to the CTreeCtrl...
void CClass::Whatever(CTreeCtrl &tree)
-c
Though the cough, hough and hiccough so unsought would plough me through,
enough that I o'er life's dark lough my thorough course pursue.
--Stuart Kidd
|
|
|
|
|
multi-tier architecture
hi, newbie in this... everything we code today should be packaged in components - COM (QUESTION 1: did .NET just changed this all? can we just wrap everything up in dll as Windows Service). these COM packages can communicate via:
(a) sockets, u can wrap data in XML...
(b) simple in-process local COM server (dll)
OR
simple out-of-process local COM server (exe)
(c) DCOM
QUESTION 2: now, how can i decide which technology is appropriate? of course, sockets only send "data". it doesnt invoke any service. If u need to invoke something that has NOT been previously initiated, u must resort to COM/DCOM...
thanx!
|
|
|
|
|
How can I assure if some font exist in the system?
CFont::CreateFont(...,lpszFaceName) always returns TRUE, although the lpszFaceName is fabricated! How can I validate this???
I thought maybe use Find/LoadResource() , but I don't know in which module I find those diiiamn fonts.
Help me, while sanity is on my side...
--BlackSmith--
"With the help of all mighty", 2001, Me.
|
|
|
|
|
The CreateFont function does not create a new Windows GDI font. It merely selects the closest match from the fonts available in the GDI’s pool of physical fonts.
from msdn ... meaning that the non-failure of the CreateFont() function is intended ... a font nearest to what you requested is always made available
if you want a specific font (bad bad bad) then you should make it part of your installer program
"... and so i said to him ... if it don't dance (or code) and you can't eat it either f**k it or throw it away" sonork: 100.18128 8028finder.com
|
|
|
|
|
BlackSmith wrote:
How can I validate this???
Check EnumFontFamiliesEx API.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Hello,
I posted on this yesterday, but I am still having trouble.
I am using this code:
<br />
if(!CryptAcquireContext(&hCryptProv, NULL, MS_DEF_PROV, PROV_RSA_FULL, 0))<br />
{<br />
HandleError("Error during CryptAcquireContext.");<br />
return -4;<br />
}
to aquire a handle to the Default CSP. Handle error goes like this:
<br />
void CFPCommonFunctions::HandleError(CString strFunction) <br />
{ <br />
CString strMsg;<br />
strMsg.Format("CFPCommonFunctions::EncryptTransFile() - %s: %u.", strFunction, GetLastError());<br />
AfxMessageBox(strMsg, MB_OK | MB_ICONEXCLAMATION);<br />
}
which returns the error 80090019 (I dont think this is formatted correctly by my function because I cant find this error in the Windows list)
I have no problems on my Win2000 machine, nor do I have a problem on my Win98 machine that has VS6 installed.
My beta users are getting this error every time, and when I try it on a fresh Win95 OSR2 install I get the error as well.
MSDN says this is compatible with Win95 OSR2 and later.
Can anybody see where I am going wrong???
Thanks
|
|
|
|
|
esapp420 wrote:
which returns the error 80090019
This error means: 'The keyset is not defined.'
By default CryptAcquireContext() will use keyset based on the user name and it does not exist automatically. Therefore your very first call on the new machine should contain CRYPT_NEWKEYSET within the flags.
I would also recommend to check if there is required provider installed on the target machine.
Martin
--------------------------------------------
C'mon we all know computers are experimental devices and should only be used for playing games.
Using them for alternative stuff like business, is clearly not using them for what they are intended.
Colin Davies
|
|
|
|
|
And another thing, here is the Mailing List Archives of CryptoAPI@DISCUSS.MICROSOFT.COM where you can more information specific to CAPI than here.
Martin
--------------------------------------------
C'mon we all know computers are experimental devices and should only be used for playing games.
Using them for alternative stuff like business, is clearly not using them for what they are intended.
Colin Davies
|
|
|
|
|
Thank you! This is exactly what I was looking for.
Miami is going down! 08/07/2002 Welcome to the SWAMP baby!
|
|
|
|
|
OK, things are going better, but still having trouble.
After modifying my code in accordance with the above mentioned advice, I no longer have a problem with CryptAquireContext.
Now I have a problem with this:
<br />
if(!CryptDeriveKey(hCryptProv, ENCRYPT_ALGORITHM, hHash, KEYLENGTH, &hKey))<br />
{<br />
HandleError("Error during CryptDeriveKey.");<br />
return -7;<br />
}<br />
returning error 2148073481 (Invalid Flags Specified). The only Flag param is the 4th.
KEYLENGTH is defined as 0x00800000 at the top of my file for 128-bit encription key,
and ENCRYPT_ALGORITHM is defined as CALG_RC4.
I am giving it a valid hCryptProv and a valid hHash.
wincrypt.h defines only on flag under the section for CryptDeriveKey (KEY_LENGTH_MASK 0xFFFF0000).
I am new to the CryptoAPI and cant see what I am doing wrong.
Martin?? Anyone??
|
|
|
|
|
I changed KEYLENGTH to NULL. This fixed the problem, but I dont know why, or if this is the best way.
|
|
|
|
|
There were several versions of CSPs published by Microsoft. Check documentation for CryptDeriveKey() and assure that you are requesting key length supported by CSP or you are using right CSP. I think, if you will ask for a longer key than maximum length, it will refuse it with invalid flag error.
Martin
--------------------------------------------
C'mon we all know computers are experimental devices and should only be used for playing games.
Using them for alternative stuff like business, is clearly not using them for what they are intended.
Colin Davies
|
|
|
|
|
I need to swap the bytes in a struct because of little/big endian problems. Can I use swab on a struct? Is there another function or macro I can use to get around this problem?
Thanks,
Bryan
|
|
|
|
|
void SwabShort(void* wp)
{
BYTE* cp = (BYTE*) wp;
int t;
t = cp[1]; cp[1] = cp[0]; cp[0] = t;
}
void SwabLong(void* lp)
{
BYTE* cp = (BYTE*) lp;
int t;
t = cp[3]; cp[3] = cp[0]; cp[0] = t;
t = cp[2]; cp[2] = cp[1]; cp[1] = t;
}
SwabShort(&myShort);
SwabLong(&myLong);
-c
Though the cough, hough and hiccough so unsought would plough me through,
enough that I o'er life's dark lough my thorough course pursue.
--Stuart Kidd
|
|
|
|
|
thanks... works like a charm
|
|
|
|
|
I have multiple CFormView windows in a MFC Doc/View application that uses a Multiple View CSplitterWnd based class to switch out views in two of the panes. To control the app, I need to pass messages between views. I have a central control class embedded in the app's CDocument derived class that controls all the views (and maintains access to pointers to the CFormView window object via the Splitter based class).
Anyway, to the question - Should I:
1) Pass messages to the CFormView class DIRECTLY via a "virtual int SendViewMessage(...)" method since I have direct access to the CFormView based Objects;
or 2) Should I post the messages via normal Windows Message (RegisterWindowMessage) to the CFormView and let the CFormView derived classes hanlde via Message Map.
I'm not sure of the consequences of the DIRECT approach as far as the MFC Doc/View framework is concerned. I see CDocument and CView calling methods directly in MFC rather than passing messages. Is there a rule on this somewhere ???? Or, since all Doc/View framework in the same thread, does this matter at all ????
Any info would be appreciated !!!!!!
Thanks,
John
|
|
|
|
|
John Gilbert wrote:
I'm not sure of the consequences of the DIRECT approach as far as the MFC Doc/View framework is concerned. I see CDocument and CView calling methods directly in MFC rather than passing messages
There are none. You're free to invent any mechanism of data exchange between views. Or - you can use existing one - the CDocument::UpdateAllViews which gives you enough flexibility.
I'd go for UpdateAllViews first, then for custom virtual function and if this doesn't fit your model, for Windows messages.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Thanks, UpdateAllViews() will probably do the job. I did not realize that UpdateAllViews() has two user type parameters that I can use to pass my control data.
Also, someone reminded me that the CFormView Object and the actual Window are two different things. So a "Direct" call (as I was calling it) goes to the object which will eventually pass messages to the attached window anyway. I knew that , but was getting lost in the Doc/View world .
Thanks for your time to respond !!!!!
John
|
|
|
|
|
I'm trying to rename the exiting folder, let's say folder1 to folder2
then I create a new folder called folder1.
1) but my renaming, rename(), method doesn't work, it only works for renaming file name. not for folder name.
2) a new folder didn't get created..
what's wrong..
here's my code
<br />
#include <direct.h>
<br />
void JobAction::renamefolder(char *oldpath)<br />
{<br />
<br />
cout<<" renaming folder"<<endl;<br />
<br />
char newpath[_MAX_PATH];<br />
strcpy(newpath,oldpath);<br />
int oldpathlen = strlen(oldpath);<br />
newpath[oldpathlen]=NULL;<br />
<br />
<br />
parseAstring(newpath,'\\',RIGHT);
<br />
strcat(newpath,"\\output1");
cout<<"oldpath: "<<oldpath<<endl<<"newpath: "<<newpath<<endl;<br />
<br />
rename(oldpath,newpath);
createDirectory(newpath);<br />
<br />
<br />
}<br />
<br />
<br />
bool JobAction::createDirectory(char *dir)<br />
{<br />
<br />
if(strlen(dir) > 3)<br />
{<br />
parseAstring(dir,'\\',RIGHT); <br />
cout<<dir<<endl;<br />
createDirectory(dir);<br />
} <br />
_mkdir((const char*)dir);<br />
return true;<br />
}<br />
thank you
|
|
|
|
|
Use
int SHFileOperation(<br />
LPSHFILEOPSTRUCT lpFileOp<br />
);
Mustafa Demirhan
http://www.macroangel.com
Sonork ID 100.9935:zoltrix
<nobr>They say I'm lazy but it takes all my time
|
|
|
|
|
Return Value
Each of these functions returns 0 if it is successful. On an error, the function returns a nonzero value and sets errno to one of the following values:
EACCES
File or directory specified by newname already exists or could not be created (invalid path); or oldname is a directory and newname specifies a different path.
ENOENT
File or path specified by oldname not found.
EINVAL
Name contains invalid characters.
For other possible return values, see _doserrno, _errno, syserrlist, and _sys_nerr.
Remarks
The rename function renames the file or directory specified by oldname to the name given by newname. The old name must be the path of an existing file or directory. The new name must not be the name of an existing file or directory. You can use rename to move a file from one directory or device to another by giving a different path in the newname argument. However, you cannot use rename to move a directory. Directories can be renamed, but not moved.
_wrename is a wide-character version of _rename; the arguments to _wrename are wide-character strings. _wrename and _rename behave identically otherwise.
Check errno to see what the error was.
Todd Smith
|
|
|
|
|
Hi
My application is C++ using MFC, generated by VC6++ AppWizard (exe), is a MDI and has a CView and a CScrollView in a splitted window. It has the usual status bar generated by the AppWizard.
Now I want to add a second status bar right above the first one.
Until now I just "duplicated" the code of the CStatusBar in MainFrm.h and MainFrm.cpp - and it works: the status bar is there, I can define and access several panes.
The problem is: the second status bar although has this "resizing triangle" - which produces unwanted effects when used.
The question is: how to remove this "resizing triangle"?
Screenshot is here.
Thanks,
Matthias
|
|
|
|
|
TeeTeeHaa wrote:
The problem is: the second status bar although has this "resizing triangle" - which produces unwanted effects when used.
The size grip appears because the parent window is resizable. trace into the CStatusBar::Create() and you will see:
if (pParentWnd->GetStyle() & WS_THICKFRAME)<br />
dwStyle |= SBARS_SIZEGRIP;<br />
This is why the size grip appears, even if you create it without the SBARS_SIZEGRIP flag. I think you can acomplish what you want by creating your own class derived from CStatusBar, and override PreCreateWindow().
Enis Arif
-----------
"I am enough of an artist to draw freely upon my imagination. Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world." (Albert Einstein)
|
|
|
|