|
I've been looking for an easy way to encrypt data with an API function but all I found - e.g DPAPI - use machines & users credentials and so on whereas I only want to provide a password to retreive the original data from any users and any computer.
Any help would be appreciated.
Richard
Tout programme dont la fiabilité dépend de l'homme n'est pas fiable
|
|
|
|
|
|
Hi,
I've got a very weird problem. When my MFC Dialog based app starts it stops after 10 seconds or so. without any reason : no crash message, no error debug message, nothing....
I don't need to do anything (click on a control, edit some text, etc.) it just stops.
If someone had the same kind of problem or knows what it's all about please let me know.
thank.
|
|
|
|
|
could you give us your code written into OnInitDialog() ?
else, what messages does your handler catch ?
TOXCCT >>> GEII power
|
|
|
|
|
<code>
BOOL CFrontEndWin32Dlg::OnInitDialog()
{
CDialog::OnInitDialog();
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
SetIcon(m_hIcon, TRUE);
SetIcon(m_hIcon, FALSE);
CheckInstallState();
UpdateText();
#if COMPILE_FOR_AUTORUN
if (e_ISNotInstalled == m_InstallState)
{
char VolumeName[FILENAME_MAX];
char CurrentPath[MAX_PATH];
getcwd(CurrentPath, sizeof(CurrentPath));
CurrentPath[3] = '\0';
if (TRUE == GetVolumeInformation(CurrentPath, VolumeName, sizeof(VolumeName), 0, 0, 0, 0, 0))
{
if (0 != strcmpi(MAIN_INSTALL_DISK_VOLUME_NAME, VolumeName))
{
char Buffer[512];
LoadString(AfxGetResourceHandle(), IDS_INSERT_DISK_ONE, Buffer, sizeof(Buffer));
AfxMessageBox(_T(Buffer), MB_OK);
OnCancel();
}
}
}
#endif // COMPILE_FOR_AUTORUN
return TRUE;
}
BEGIN_MESSAGE_MAP(CFrontEndWin32Dlg, CDialog)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_WM_DESTROY()
ON_CBN_SELENDOK(IDC_COMBO_LANGUAGE, OnCbnSelendokComboLanguage)
ON_BN_CLICKED(ID_DISPLAY, OnBnClickedDisplay)
ON_BN_CLICKED(ID_HELP, OnBnClickedHelp)
ON_BN_CLICKED(ID_CONTROLLERS, OnBnClickedControllers)
ON_BN_CLICKED(IDOK, OnBnClickedOk)
END_MESSAGE_MAP()
</code>
|
|
|
|
|
Well have you set up some recurrsive function that calls every clock tick????
I guess its mostly due to stack overflow. Checkout wheather you have any infinite loop or never ending recurrsive function call.
God is Real, unless declared Integer.
|
|
|
|
|
But if it was an stack overflow i could see it in debug mode !!
another weirdo too : when i run regedit the same thing happens....
|
|
|
|
|
virus beahavior....
already saw something like that.
TOXCCT >>> GEII power
|
|
|
|
|
Humm, I think you should run the anti-virus software.
God is Real, unless declared Integer.
|
|
|
|
|
toxcct, Mr.Prakash,
actually you were left er... right
It seems that a virus is at work in my job's network. Not really harmfull (can really a virus NOT harm you ??) but it took the day to understand that my problem may be was viral, since two other co-workers had the same problem with other apps (regedit and a dictionary software).
It's the first time I get to meet a virus and I still don't understand who can code a virus that close apps....
Anyway, the lesson of the day was : communicate as much as you can
|
|
|
|
|
haust wrote:
actually you were left er... right
not able to get those words rite huh ?
haust wrote:
Not really harmfull
Not harmfull in the senceof not doing any destruction, but it wasted lot of your time and thats what the virus do and if time is money for your company and so also money too.
haust wrote:
I still don't understand who can code a virus that close apps....
Well generally the virus writter wont give away his identity, but he may be sitting rite next to you and smiling every time your application closes.
I'll write a suicide note on a hundred dollar bill - Dire Straits
|
|
|
|
|
I have a SDI with splitters that look like this:
_____________
|......|............|
|View|............|
|Tree|ViewList.| ....(fig. 1)
|......|............|
|......|............|
|____|_______|
and I am trying to make a second View (Frame) with splitters that look like this:
________________
|.....| View 2........|
|.....|___________|
|.....|.....|...........|
|V1..|.....|...........|
|.....|V3..| View 4.| (fig. 2)
|.....|.....|............|
|.....|.....|............|
|___|___|________|
The 1. question: How can I switch between the frames (Views)?
The 2. question: How can I create the 2. frame with splitter to look as shown (fig. 2).
It is important for the first version, that I can switch between to frames. Maybe it is easier to make the second frame like this (no Splitter in a splitter –fig. 3):
_______________
|V 1..| view2.....|
|____|_________|
|View|..............| .... (fig. 3)
| 3...|View 4.....|
|......|..............|
|......|..............|
|____|________|
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, <br />
CCreateContext* pContext) <br />
{<br />
if (!m_wndSplitter.CreateStatic(this,1,2))<br />
{<br />
return FALSE;<br />
}<br />
CRect rect;<br />
GetClientRect(&rect);<br />
CSize sizeTree = rect.Size();<br />
<br />
sizeTree.cx = rect.Width()/4; <br />
<br />
if (!m_wndSplitter.CreateView(PANE_ROW_ZERO, eTreeWinPane, RUNTIME_CLASS(CViewTree),<br />
sizeTree, pContext)|| <br />
(!m_wndSplitter.CreateView(PANE_ROW_ZERO, eListWinPane, RUNTIME_CLASS(CViewList),<br />
CSize(100,100), pContext)))<br />
{ <br />
return FALSE;<br />
}<br />
return TRUE;<br />
}<br />
Must I use OnCreateClient()function, or there is an alternative?
Thanx in advance..
Nadin_Sam
|
|
|
|
|
Dear friends,
What is the equivalent function with MoveFileEx w/ dwFlags=MOVEFILE_REPLACE_EXISTING in Windows 98? MoveFileEx is not suppoted in Windows 98, so I have to use its old version, which is MoveFile. However, MoveFile failed when lpNewFileName already exists. Drop me your advices. Thanks so much.
BRs.
____
Tuan
|
|
|
|
|
DeleteFile first
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
As Papa says, you have to delete the old file first.
However, if it happens that the old file is in use or can't be deleted for some other reason, you'll have to tinker with Wininit.ini so that it gets replaced on reboot.
Helpful MSDN article[^]
Sometimes I feel like I'm a USB printer in a parallel universe.
|
|
|
|
|
I am working on a small graphics problem at the moment. At the time it runs, no windows for my application have been created, but I need to generate some disabled bitmap images.
To do this I do:
CDC dc;
dc.Attach(::GetDC(NULL)); // get screen DC
CBitmap bmp;
bmp.CreateCompatibleBitmap(&dc, x, y);
...
::ReleaseDC(NULL, dc.Detach());
The problem is the CreateCompatibleDC() function always returns a monochrome bitmap. I would have thought that on a screen display running in 32-bit colour the compatible bitmap should be in the same colour depth. Anyone any idea how to solve the problem? Its the bottle neck on my current project.
|
|
|
|
|
This is what I've been using with no problems (it is a service application)...
<br />
CDC oMemDC;<br />
CBitmap *pOldBmp;<br />
CBitmap oBmp;<br />
<br />
long lWidth = 300;<br />
long lHeight = 200;<br />
pCallContextObj->GetParameterValue("ChartWidth",&lWidth);<br />
pCallContextObj->GetParameterValue("ChartHeight",&lHeight);<br />
<br />
CRect oBmpSize(0,0,lWidth,lHeight);<br />
<br />
oMemDC.CreateCompatibleDC(NULL);<br />
int iOldMapMode = oMemDC.SetMapMode(MM_TEXT);<br />
<br />
CWindowDC dcScreen(NULL);<br />
<br />
oBmp.CreateCompatibleBitmap(&dcScreen,oBmpSize.Width(), oBmpSize.Height());<br />
<br />
pOldBmp = oMemDC.SelectObject(&oBmp);<br />
<br />
WORD wChartType = 88;<br />
pCallContextObj->GetParameterValue("ChartType",&wChartType);<br />
<br />
<br />
....<br />
....<br />
<br />
oMemDC.SetMapMode(iOldMapMode);<br />
oMemDC.SelectObject(pOldBmp);<br />
<br />
oMemDC.DeleteDC();<br />
<br />
onwards and upwards...
|
|
|
|
|
That looks like a possible solution. I will give it a try.
|
|
|
|
|
Cheers,
with a little modification, and hunting, I got the problem sorted using some of your suggestions.
Thank you.
|
|
|
|
|
Glad I could help
onwards and upwards...
|
|
|
|
|
If you use a DIBSection, you can specify whatever colour depth you like, independant of the screen. There is a DIBSection wrapper on CP, written by Chris Maunder.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Hello, I've been working on this program and I recently tested it with rational purify for memory leaks, only to find that gethostname() always results in the above mentioned message:
<br />
Array bounds write in WideCharToMultiByte<br />
The code is working, and I've tested it with other people's code who use gethostname, it is always the same.
Any ideas?
Have no fear of perfection - You will never reach it
|
|
|
|
|
i don't know if it is possible .. but if someone has any idea about how this can B done .. please respond to this..
G_Bela
|
|
|
|
|
Don't you mean Task Manager? Program Manager is a hold-over from Windows' early days.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
yes.. i gues then it's Task Manager..
but the same question still stands without beeing answered to.
G_bela
|
|
|
|