|
It's not easy to read your question. Please edit the message and put <pre></pre> tags around he code blocks so they can be read more easily. From a quick glance it looks like your indexing is not working properly, check the pointer indexing in your GetRegisters() function.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Perhaps if you formatted your code so it's readable?
Steve
|
|
|
|
|
I'm a new one, which want to learn linux. but i do't how to study it.
i have use ubuntu some days.but i find i use it like windows. i don't
understand somethings about linux,but just use g++.
I want to be a coder in linux, so give me some advices , thank you very
much
|
|
|
|
|
Here, perhaps this will get you started: Programming for Linux[^]
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
In my current VS C++ app I create an fstream log file for output and all works fine. It's initialized in the constructor declaration. Now I want to close it and start a new one upon the log file reaching a size limit. I've tried a number of things with no success. One approach was to not initialize in the constructor and use .open. That didn't work. Another was to go back to initialize in the constructor, then close, and rename, and open again. That didn't work either. Either I am missing some key point here or just doing some samll thing incorrectly. Any help would be appreciated.
Thanks
|
|
|
|
|
Alan Kurlansky wrote: That didn't work.
This sort of statement is really not very helpful; nobody can guess why it did not work. Explain exactly what you did and what results you got, if there is a short code snippet that helps with the explanation then include that as well. And don't forget to put code between <pre></pre> tags.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
Sorry about that. But I was able to get things to work by reducing the scope of the file management. Now I am opening, closing, renaming the file all from within a function, using all local and local static variables.
|
|
|
|
|
Why "FlatSB" is useless in WTL?
::InitializeFlatSB,::FlatSB_EnableScrollBar,::FlatSB_SetScrollProp...return 0.
Create a Dialog(or Edit Control、List Control...),
Set show HorizontalScrollBar and VerticalScrollBar,
in OnInitDialog(...):
BOOL bRet = ::InitializeFlatSB(m_hWnd);
bRet = ::FlatSB_EnableScrollBar(m_hWnd,SB_BOTH,ESB_ENABLE_BOTH);
bRet = ::FlatSB_SetScrollProp(m_hWnd, WSB_PROP_VSTYLE, FSB_FLAT_MODE, TRUE);
bRet = ::FlatSB_SetScrollProp(m_hWnd, WSB_PROP_HSTYLE, FSB_FLAT_MODE, TRUE);
// change scrollbar color
bRet = ::FlatSB_SetScrollProp(m_hWnd, WSB_PROP_HBKGCOLOR, 0x008000ff, TRUE);
bRet = ::FlatSB_SetScrollProp(m_hWnd, WSB_PROP_VBKGCOLOR, 0x0000ff80, TRUE);
this works on MFC!
|
|
|
|
|
Hi,
dancingfish wrote: Why "FlatSB" is useless in WTL?
WTL support for flat scroll bars in atlctrls.h:
#if (_WIN32_IE >= 0x0400) && !defined(_WIN32_WCE)
template <class T>
class CFlatScrollBarImpl
{
template <class TBase>
class CFlatScrollBarT : public TBase, public CFlatScrollBarImpl<CFlatScrollBarT< TBase > >
{
typedef CFlatScrollBarT<ATL::CWindow> CFlatScrollBar;
As Comctl32.dll versions 6.00 and later do not support flat scroll bars check (WTL::RunTimeHelper::IsCommCtrl6() == false) before use
cheers,
AR
Edit: Added CommCtrl version check suggestion.
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
modified on Wednesday, November 10, 2010 5:15 AM
|
|
|
|
|
hi
I know the class CFlatScrollBarImpl, i've got a failed try, so i directly call these APIs(::InitializeFlatSB,::FlatSB_EnableScrollBar,::FlatSB_SetScrollProp...), but still same problem.
BOOL bRet;
bRet = ::InitializeFlatSB(m_hWnd);
bRet = ::FlatSB_EnableScrollBar(m_hWnd,SB_BOTH,ESB_ENABLE_BOTH); // bRet = 0
bRet = ::FlatSB_SetScrollProp(m_hWnd, WSB_PROP_VSTYLE, FSB_FLAT_MODE, TRUE);
bRet = ::FlatSB_SetScrollProp(m_hWnd, WSB_PROP_HSTYLE, FSB_FLAT_MODE, TRUE);
bRet = ::FlatSB_SetScrollProp(m_hWnd, WSB_PROP_HBKGCOLOR, 0x6fa1d9, TRUE);
bRet = ::FlatSB_SetScrollProp(m_hWnd, WSB_PROP_VBKGCOLOR, 0x00ff00, TRUE);
or
private:
CFlatScrollBar* m_pScrollbarFlat;
m_pScrollbarFlat= new CFlatScrollBar(m_hWnd);
bRet = m_pScrollbarFlat->FlatSB_Initialize();
bRet = m_pScrollbarFlat->FlatSB_EnableScrollBar(SB_BOTH); // bRet = 0
bRet = m_pScrollbarFlat->FlatSB_SetScrollProp(WSB_PROP_VSTYLE, FSB_FLAT_MODE, TRUE);
bRet = m_pScrollbarFlat->FlatSB_SetScrollProp(WSB_PROP_HSTYLE, FSB_FLAT_MODE, TRUE);
bRet = m_pScrollbarFlat->FlatSB_SetScrollProp(WSB_PROP_HBKGCOLOR, 0x6fa1d9, TRUE);
bRet = m_pScrollbarFlat->FlatSB_SetScrollProp(WSB_PROP_VBKGCOLOR, 0x00ff00, TRUE);
bRet return 0 on "FlatSB_EnableScrollBar".
it works in MFC.
I don't know what's wrong with this.
|
|
|
|
|
Hi,
dancingfish wrote: I know the class CFlatScrollBarImpl, i've got a failed try
As you don't explain what you tried and what you mean by failed it is difficult to help you.
Use WTL::CFlatScrollBar this way:
class CFlatScrollBarWnd : public CWindowImpl<CFlatScrollBarWnd, CFlatScrollBar>
{
public:
DECLARE_WND_CLASS(NULL)
BEGIN_MSG_MAP(CFlatScrollBarWnd)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
END_MSG_MAP()
LRESULT OnCreate(UINT , WPARAM , LPARAM , BOOL& )
{
FlatSB_Initialize();
FlatSB_SetScrollProp(WSB_PROP_VSTYLE, FSB_ENCARTA_MODE);
FlatSB_ShowScrollBar(SB_BOTH);
FlatSB_SetScrollRange(SB_HORZ, 0, 2000);
FlatSB_SetScrollRange(SB_HORZ, 0, 1000);
return 0;
}
};
Remember that the Flat SB control is not supported on WinXP and later, so nothing happens there.
Good luck,
AR
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
|
|
|
|
|
"Remember that the Flat SB control is not supported on WinXP and later, so nothing happens there."
but the Flat Scrollbar is shown in MFC.(::InitializeFlatSB,::FlatSB_EnableScrollBar,::FlatSB_SetScrollProp... all return 1)
Maybe this is the point!("not supported on WinXP and later" just in WTL? i can't understand this.)
my OS is Windows XP.
I just try to show Flat Scrollbar, but ::FlatSB_EnableScrollBar return 0 however i do in WTL.
|
|
|
|
|
To have it working on XP remove the manifest from the executable, and indeed it is supported.
You may check it this way:
With the WTL AppWizard create a FlatScrollBar project with all default selections.
Change FlatScrollBarView.h to:
#pragma once
class CFlatScrollBarView :
public CWindowImpl<CFlatScrollBarView, CFlatScrollBar>
{
public:
DECLARE_WND_CLASS(NULL)
BEGIN_MSG_MAP(CFlatScrollBarView)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
END_MSG_MAP()
LRESULT OnCreate(UINT , WPARAM , LPARAM , BOOL& )
{
FlatSB_Initialize();
FlatSB_SetScrollProp(WSB_PROP_VSTYLE, FSB_ENCARTA_MODE);
FlatSB_SetScrollProp(WSB_PROP_CXVSCROLL, 100);
FlatSB_SetScrollProp(WSB_PROP_HBKGCOLOR, RGB(0x80, 0, 0x80));
FlatSB_ShowScrollBar(SB_BOTH);
FlatSB_SetScrollRange(SB_HORZ, 0, 2000);
FlatSB_SetScrollRange(SB_HORZ, 0, 1000);
return 0;
}
LRESULT OnDestroy(UINT , WPARAM , LPARAM , BOOL& )
{
FlatSB_Uninitialize();
return 0;
}
};
In (VS2008) Project->FlatScrollBar Properties->Manifest Tool->Input and Output Set Embed Manifest to No.
Compile and run under XP, you will get a flat SB
cheers,
AR
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
modified on Friday, November 12, 2010 5:39 AM
|
|
|
|
|
Dear CodeProject
I'm developing an OLE DB Provider using Microsoft OLE DB Provider templates.
I have some problems with this project when I want to add bookmark capability to it.
My question:
Is it necessary to include bookmark column in column rowset schema in session object?I mean when we popultae rowset with information of columns of a table,should we add a record for bookmark (specially for a self bookmark with orddinal 0)?
Thank you very much
Reza As'adi
mreza_asadii@yahoo.com
|
|
|
|
|
hello
i want to catch divide by zero and bad pointer exception how i can do it ? why these codes don't work?
#include<iostream><br />
#include<csetjmp><br />
#include<stdexcept><br />
<br />
using namespace std;<br />
int main(){<br />
int a=0;<br />
int b;<br />
try{<br />
b=12/a;<br />
}<br />
catch(...){<br />
cout<<"an exception acurred :"<<endl;<br />
b=12;<br />
}<br />
}
#include<iostream><br />
#include<stdexcept><br />
using namespace std;<br />
int main(){<br />
int *r;<br />
try{<br />
if(r[0]=23)<br />
;<br />
}<br />
catch(std::exception &e){<br />
cout<<"error"<<endl;<br />
}<br />
}<br />
modified on Sunday, November 7, 2010 2:57 PM
|
|
|
|
|
The try/catch statements are able to handle synchronous exceptions, i.e. exceptions that are explicitly thrown by the guarded code using the throw instruction.
What you are trying to catch are asynchronous exceptions that are thrown by the microprocessor under certain conditions.
What you want to do require platform specific API; on Windows systems you can do it in three different ways:
- use the
__try/__except statements (see try-except Statement (Windows)[^]) - install a vectored exception handler (see Vectored Exception Handling (Windows)[^])
- translate asynchronous exceptions to C++ (synchronous) exceptions (see /EH (Exception Handling Model) (C++)[^] and _set_se_translator (CRT)[^])
|
|
|
|
|
ok thanks a lot.do you know how to do it in linux(fedora?)
|
|
|
|
|
#include<iostream>
#include<csetjmp>
#include<stdexcept>
using namespace std;
int main(){
int a=0;
int b;
try{
if(a==0)
throw "Denominator should not be zero"
b=12/a;
}
catch (const char msg[])
{
MessageBox(msg,"Exception",MB_OK | MB_ICONEXCLAMATION);
}
catch(...){
cout<<"an exception acurred :"<<;endl;
b=12;
}
}
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
I have outlook add-in developed using ATL C++. It has 2 button in outlook standard toolbar.
it will work in all versions of outlook (outlook 2000 onwards) fine. After clicking new mail (another window will appear) there buttons not appearing. please tell the way how to add a button for that window.
|
|
|
|
|
Hi,
I have an hdf (extension )file , i need to read that file and convert it into an ASCII format using C program.
The problem is small but not finding a way.
Thanks
|
|
|
|
|
You have to describe HDF file format
|
|
|
|
|
Does this page[^] help at all?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|
|
|
Very thanks for your reply....
Only documentation is not helpful,
I need a way to read that particular file in a format it is written to convert it to text.
Thanks
|
|
|
|
|
Hi Friends,
Iam new to VC++, i have 2 dialogs with me ... every time i run it Dialog 1 is opening. I want to run Dialog 2 as a startuo dialog.. where i have to change the code... Please help me...
|
|
|
|
|