|
Greetings...
I want a have Excel like flat tab in my application at the bottom of my tab control.
Can somebody suggest me a way or any article on net which tells me how to go through it.
I am not using MFC, only Win32 APIs
Thanks in advance.
Ritesh
|
|
|
|
|
I know this is MFC but the extended styles should apply for MFC and Win32 API. I'm not sure what the Excel like tabs are like but this style makes buttons out of the tabs. Is that what you're looking for?
m_pTabCtrl = new CMyTabCtrl;
CRect cltRect;
GetClientRect(&cltRect);
m_pTabCtrl->Create(WS_CHILD|WS_VISIBLE | TCS_BUTTONS | TCS_FLATBUTTONS, cltRect, this, IDC_TAB1);
DWORD dwExtStyle = m_pTabCtrl->GetExtendedStyle();
m_pTabCtrl->SetExtendedStyle(dwExtStyle | TCS_EX_FLATSEPARATORS);
m_pTabCtrl->ShowWindow(true);
TC_ITEM TabCtrlItem;
TabCtrlItem.mask = TCIF_TEXT;
TabCtrlItem.iImage = -1;
for(i = gSites.size(); i > 0; i--)
{
TabCtrlItem.pszText = gSites[i-1].GetId();
m_pTabCtrl->InsertItem( 0, &TabCtrlItem );
}
m_pTabCtrl->SetCurSel(0);
|
|
|
|
|
Hello there,
I'm writing a database program ...
I used ADO and Microsoft.Jet.OLEDB.4.0 for opening my Access 2000 database ...
I must install Jet 4.0 for using Access 2000 ???
or MSDAC 2.6 ???
I downloaded both of them, but i want to know which of them is neccessery to install for using ADO with Access 2000 ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
MDAC contains all you need for ADO with Access 2000.
Michael
Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.
|
|
|
|
|
Thanks
Other question about MSDAC, in microsoft data access downloads i saw thease item available for download:
MSDAC 2.7 (it is version that is currently in xp os)
MSDAC 2.6(SP2)
MSDAC 2.5
Some of my users use still Win98, which item is better to update ?
MSDAC 2.7 or MSDAC 2.6 ??
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hadi_Rezaie wrote:
I must install Jet 4.0 for using Access 2000 ???
or MSDAC 2.6 ???
Both of them. The Jet files are not a part of MDAC from version 2.5 (or 2.6?) up.
Pavel
Sonork 100.15206
|
|
|
|
|
Hello Pavel
Could you tell me what's the reason to update microsoft Jet engine when i installed MDAC 2.6 or later ?
What Jet engine exactly do ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Jet engine is a database engine for mdb files (MS Access uses it).
If you want use mdb/Access database format, you need it. If you are using other database engine (SQL Server or other) you don't need it. MFC CDao???? classes use the Jet engine.
Pavel
Sonork 100.15206
|
|
|
|
|
Hi,
Here is code :
CString Valeur="1250.20";
int Fractional = ((atof(Valeur) - atoi(Valeur)) * 100);
Value of Fractional variable after thsi operation is 19 ( False )
I must be 20
Where is my error
Thanks in advance
|
|
|
|
|
Hello,
Try this one:
CString Valeur="1250.20";
int Fractional = ((atof(Valeur) - atoi(Valeur)) * 100.0);
change 100 to 100.0
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Result of atof-atoi is converted to int before multiplication.
Pavel
Sonork 100.15206
|
|
|
|
|
Hello there,
How can i get ADO version ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hello there,
Is there any API function for registering ActiveX or DLLs ??
Or i have to use WinExec to run regsvr32 to regestring ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Try something like:
typedef HRESULT (STDAPICALLTYPE *FnDllEntryPoint)(void);
HMODULE hMod = ::LoadLibrary( pszDllName );
if ( hMod != NULL )
{
FnDllEntryPoint lpDllEntryPoint = (FnDllEntryPoint)::GetProcAddress( hMod, "DllRegisterServer" );
if ( lpDllEntryPoint != NULL )
{
if ( SUCCEEDED( (*lpDllEntryPoint)() ) )
{
// Success
}
else
{
// Registration failed
}
}
else
{
// Failed to find entry point - probably not a COM object
}
::FreeLibrary( hMod );
}
else
{
// Failed to load library
}
Dave
|
|
|
|
|
That's it
Thanks aloooooot !
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hi!
I've created a MFC Dll. I have exported a function which must display a dialog box. I have tried to use the CDialog class but the dialog doesn't appear.
Here a portion of my code(CreatePageDlg is the dialog class of the dialog I want to display):
#include "stdafx.h"
#include "web.h"
#include "CreatePageDlg.h"
__declspec(dllexport) void __cdecl ShowDialog(CString FileName)
{
CCreatePageDlg dlg;
dlg.DoModal ();
if (dlg.DoModal ()==IDOK)
{
}
}
What's wrong.
Thks in advance!
Appstmd
|
|
|
|
|
Have you tried debug stepping into the DoModal function, this should give you more clues to what the problem. Also the sample code provided will show the dialog twice.
Is the DLL's resource identifier range different to the applications's resource id range?
Michael
Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.
|
|
|
|
|
You might have been bitten by MFC dialog creation code that tries to load the resource with the same name or ID from the executable, not from the DLL itself.
You must make your DLL an "MFC extension DLL". How to do this is reasonably well documented in e.g MSDN.
|
|
|
|
|
Where can I find the registry key for the path of the current WebBrowser / EmailReader?
Who can I get/read the icons from these exe-files ?
Please, give me an answer ...
Stefan-Mihai MOGA
info@mogamihai.ro
|
|
|
|
|
default browser: HKEY_CLASSES_ROOT\http\shell\open\command
|
|
|
|
|
Thank you, but what about the default email reader (outlook / outlook express / ...) ???
Thanks again ...
|
|
|
|
|
Hmm.. maybe this !?
HKEY_LOCAL_MACHINE\SOFTWARE\Clients\Mail
----------------------------
never stop coding.
|
|
|
|
|
Thank you very much for your quickly response, but...
what can you tell me about the fallowing keys ?
1. HKEY_CLASSES_ROOT\mailto\shell\open\command
2. HKEY_CLASSES_ROOT\Microsoft Internet Mail Message\shell\open\command
3. HKEY_CLASSES_ROOT\Microsoft Internet News Message\shell\open\command
---------------------------------------------
start small, think big ...
---------------------------------------------
Stefan-Mihai MOGA
info@mogamihai.ro
|
|
|
|
|
hi!
I'm working on a Consumer - producer program. It is required to measure the time that the producer producing, waiting and the consumer consumes and waiting. However i'm having some trouble measuring those. Does anyone have any ideas?
The following is my code that i've written so far:
<br />
#include "buffer.h"<br />
#include <windows.h><br />
#include "screen.h"<br />
HANDLE NFull, NEmpty;<br />
HANDLE mutexProTime, mutexConTime;<br />
int sleepTimePro = 100;
int sleepTimeCon = 200;
<br />
void Buffer::BufInit(void)<br />
{<br />
bufferSize = 8; <br />
NxtIn = 0;<br />
NxtOut = 0;<br />
NFull = CreateSemaphore(NULL, 0, bufferSize, 0);<br />
NEmpty = CreateSemaphore(0, bufferSize, bufferSize, 0);<br />
mutexProTime = CreateMutex(NULL, TRUE, 0);<br />
mutexConTime = CreateMutex(NULL, TRUE, NULL);<br />
proTime = proWaitTime = 0;
conTime= conWaitTime = 0;
<br />
}<br />
void Buffer::BufPut(char c)<br />
{<br />
<br />
if(WaitForSingleObject(NEmpty, 10) != WAIT_OBJECT_0)<br />
proWaitTime += 100;<br />
<br />
buffer[NxtIn] = c;<br />
NxtIn = (NxtIn+1) % bufferSize;<br />
if (NxtIn == 0)<br />
{<br />
scrWriteAt(0, 5, " ");<br />
scrWriteAt(0, 5, "Producer is waiting");<br />
}<br />
else<br />
{<br />
scrWriteAt(0, 5, " ");<br />
scrWriteAt(0, 5, "Producer is generating ");<br />
}<br />
ReleaseSemaphore(NFull, 1, 0);<br />
Sleep(sleepTimePro);<br />
<br />
proTime += sleepTimePro;<br />
<br />
<br />
}<br />
char Buffer::BufGet(void)<br />
{ <br />
char s; <br />
if(WaitForSingleObject(NFull, 10) != WAIT_OBJECT_0)<br />
conWaitTime += 100;<br />
s = buffer[NxtOut];<br />
NxtOut = (NxtOut+1) % bufferSize;<br />
<br />
if (NxtOut == 0)<br />
{<br />
scrWriteAt(0, 7, " ");<br />
scrWriteAt(0,7,"Consumer is waiting " );<br />
}<br />
else<br />
{<br />
scrWriteAt(0, 7, " ");<br />
scrWriteAt(0, 7, "Consumer is consuming ");<br />
}<br />
ReleaseSemaphore(NEmpty, 1, 0);<br />
Sleep(sleepTimeCon);<br />
conTime += sleepTimeCon;<br />
return s;<br />
<br />
}<br />
long Buffer::TimeProducerProduces()<br />
{<br />
<br />
<br />
return proTime;<br />
}<br />
long Buffer::TimeProducerWaits()<br />
{<br />
return proWaitTime;<br />
}<br />
long Buffer::TimeConsumerConsumes()<br />
{<br />
return conTime;<br />
}<br />
long Buffer::TimeConsumerWaits()<br />
{<br />
return conWaitTime;<br />
}<br />
it seems to me that the above does not work, and it always produce the same answer each run.
|
|
|
|
|
What OS do you design the program for? For example, you could get a quite accurate execution time of a thread using GetThreadTime().
Kuphryn
|
|
|
|