|
|
i will read some sites
Big thanks
|
|
|
|
|
I'm sorry for not helping you out with your specific problem.
But I'm at work and have some other things to attend to...
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
What error do you get?
Does adding #include "Haupt.h" to the top of Einstellungen.cpp fix it?
|
|
|
|
|
No
But i changed the principle ... now it works savely
But nevertheless thanks for your ansers kakan and benjymous
|
|
|
|
|
|
I already know how to get the buffer is full (by select function). but, how can set the buffer to empty?
|
|
|
|
|
my problem is that I insert a control activeX in my CFormView (the control is
an interface ocx) so it generate to files .cpp and .h which contain all methods and proprties.
I wanted to get those methods and members in a class called port.cpp for example
so i put in this class port.h this line
CMyinterfacectrl1 *pDTC;
and I use it like this in port.cpp
pDTC->setWorkIndex(...);
pDTC->ComPortOpen(....);
in my CFormView.cpp
I call my CDialog like this:
Cport p;
p.pDTC=&m_DTC;
p.DoModal();
But when I run the programm and press OK in the CDialog I have this
message :
Exception not generated 0x10008226 dans prog.exe:0xC0000005:
Violation of access when writing in 0x00000030.
and the machine code is: 10008226 rep stos dword ptr [edi]
But my variable is initialized I don't know where is the prob
sometimes it works and some times i have this message
thank's
zizzzzzzzzzzz
|
|
|
|
|
I don't really understand what you are trying to do...
Anyway, if you write this: CMyinterfacectrl1 *pDTC; and then use it like that:
pDTC->setWorkIndex(...);
pDTC->ComPortOpen(....);
Then you'll get a problem because your pointer is not initialized, thus it points to invalid memory. You first need to create an instance of your class using new (don't forget to delete it afterwards).
|
|
|
|
|
I thought that those lines initialize it:
Cport p;
p.pDTC=&m_DTC;
p.DoModal();
or not ?
|
|
|
|
|
Your explanation is very unclear. Post some relevant code with the explanations, it is very difficult to see what you did.
For me pDTC was a global variable (you said that you put the code in port.h, you didn't say that it was a member of a class).
And also, explain when exactly does the problem appear (use also your debugger to narrow the problem)
|
|
|
|
|
sorry ! and thank's for the advice
I'll try to explain more:
when I insert the control activeX in my CFormView I create for it a member
variable with the wizard of "VC++ .net" as a control in the category.
so it's like this :
CPrincipale::CPrincipale()
: CFormView(CPrincipale::IDD)
, m_DTC()
{
}
then I do what I said before
i put in the class port.h this line:
CMyinterfacectrl1 *pDTC; //pointer to the class which was created when I insert the control.
and I use it like this in port.cpp
pDTC->setWorkIndex(...);
pDTC->ComPortOpen(....);
in my CFormView CPrincipale.cpp
I call my CDialog like this:
void CPrincipale::onPort()
{
Cport p;
p.pDTC=&m_DTC;
p.DoModal();
}
I hope that is clear enough
please help me !
|
|
|
|
|
But, why are you doing that ? Why have a pointer to your activeX control in a class that has nothing to do with it ? (and your explanation is still not very clear...)
|
|
|
|
|
because if I want to add a control ActiveX I must select the FormView
right click > insert Control ActiveX
then select the control add variable > category control
so it generate two files here you are some code of itdcinterfaceCtrl.h
class CItdcinterfacectrl1 : public CWnd
{
protected:
DECLARE_DYNCREATE(CItdcinterfacectrl1)
public:
CLSID const& GetClsid()
{
static CLSID const clsid
= { 0xFB05973A, 0x3C1E, 0x46DC, { 0x95, 0x93, 0xDC, 0xEE, 0xC4, 0x29, 0xDC, 0x88 } };
return clsid;
}
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle,
const RECT& rect, CWnd* pParentWnd, UINT nID,
CCreateContext* pContext = NULL)
{
return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID);
}
BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd,
UINT nID, CFile* pPersist = NULL, BOOL bStorage = FALSE,
BSTR bstrLicKey = NULL)
{
return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
pPersist, bStorage, bstrLicKey);
}
// Attributs
public:
// Opérations
public:
// _DITDCInterface
// Functions
//
void DoorTimeSchedule(LPCTSTR DoorTimeSchedule1, LPCTSTR DoorTimeSchedule2, LPCTSTR DoorTimeSchedule3, LPCTSTR DoorTimeSchedule4)
{
static BYTE parms[] = VTS_BSTR VTS_BSTR VTS_BSTR VTS_BSTR ;
InvokeHelper(0xb, DISPATCH_METHOD, VT_EMPTY, NULL, parms, DoorTimeSchedule1, DoorTimeSchedule2, DoorTimeSchedule3, DoorTimeSchedule4);
}
void AccessDoor(LPCTSTR DoorIndex1, LPCTSTR DoorIndex2, LPCTSTR DoorIndex3, LPCTSTR DoorIndex4)
{
static BYTE parms[] = VTS_BSTR VTS_BSTR VTS_BSTR VTS_BSTR ;
InvokeHelper(0xc, DISPATCH_METHOD, VT_EMPTY, NULL, parms, DoorIndex1, DoorIndex2, DoorIndex3, DoorIndex4);
}
but if I create a class to this control and not a member variable I don't obtain attributs and function chown below!
|
|
|
|
|
zizzzz wrote: but if I create a class to this control and not a member variable
Sorry, but I still don't understand... What do you mean by creating a class to this control ?? Simply declaring an instance of your class outside your view class ? But, why do you want to do that, that's the real problem ! An activeX is a control (it inherits from CWnd), so it will be displayed on your view, dialog, ... So, it is logical that it is a member variable of your view or dialog. Why do you want it to be outside of your class ?
|
|
|
|
|
ok thank's I understand where is the prob
zizzzzzzzzzzzzzz
|
|
|
|
|
I want to hide the drive name during runtime.I have displayed a directory tree in a tree control.The code looks like this,
CString str = ((CIFlappApp *)AfxGetApp())->m_strAppDrive;
str+="\:";
str+="\\";
str+="MyFavourites";
CString str1 = str;
CreateDirectory(str,NULL);
str+="\\";
CString sub = str+"Online Bookmarks";
CreateDirectory(sub,NULL);
sub= str+"Music";
CreateDirectory(sub,NULL);
sub= str+"Pictures";
CreateDirectory(sub,NULL);
sub= str+"Documents";
CreateDirectory(sub,NULL);
m_bookmark.PopulateTree(str1);
Now when i run the application the tree is displayed like this,
D:\My Favourites
Documents
Music
OnLine Bookmarks
Pictures
I want to displat the tree like this.
Favourites
Documents
Music
OnLine Bookmarks
Pictures.
How can i do this.Can anyone help me in this.
Thanks.
|
|
|
|
|
Hi Radhika,
You can use string manipulations to remove the prefix of drive letter. There are so many helpful functions in CString class.
|
|
|
|
|
I add sth based on your code follow:
CString drv = ((CIFlappApp *)AfxGetApp())->m_strAppDrive;
drv+="\:";
drv+="\\";
CString str = drv + "MyFavourites";
CString str1 = str;
CreateDirectory(str,NULL);
str+="\\";
CString sub = str+"Online Bookmarks";
CreateDirectory(sub,NULL);
sub= str+"Music";
CreateDirectory(sub,NULL);
sub= str+"Pictures";
CreateDirectory(sub,NULL);
sub= str+"Documents";
CreateDirectory(sub,NULL);
str1.TrimLeft(drv);
m_bookmark.PopulateTree(str1);
freeman
|
|
|
|
|
radhika28 wrote:
I want to hide the drive name during runtime.I have displayed a directory tree in a tree control.The code looks like this,
CString str = ((CIFlappApp *)AfxGetApp())->m_strAppDrive;
str+="\:";
str+="\\";
str+="MyFavourites";
CString str1 = str;
CreateDirectory(str,NULL);
str+="\\";
CString sub = str+"Online Bookmarks";
CreateDirectory(sub,NULL);
sub= str+"Music";
CreateDirectory(sub,NULL);
sub= str+"Pictures";
CreateDirectory(sub,NULL);
sub= str+"Documents";
CreateDirectory(sub,NULL);
m_bookmark.PopulateTree(str1);
Now when i run the application the tree is displayed like this,
D:\My Favourites
Documents
Music
OnLine Bookmarks
Pictures
I want to displat the tree like this.
Favourites
Documents
Music
OnLine Bookmarks
Pictures.
How can i do this.Can anyone help me in this.
could you show me piece of code , which you are using to populate item in TreeCtrl
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief And You
|
|
|
|
|
hi all,
I am developing an application which moniters devices connected to usb port.. Application should allow only particular devices ... for other devices it has to block those devices with out accessing it by user?
Any suggestions????
|
|
|
|
|
How can I know if an application has started a DirectX "window" and then kill it?
Thank you!
modified 9-Mar-17 17:08pm.
|
|
|
|
|
Can you be more specific.
|
|
|
|
|
Let us say a progam starts a DirectX window. I want to write a process that can detect all directX windows started and kill them.
modified 7-Mar-17 16:45pm.
|
|
|
|
|
Hi all,
I was wondering if someone could help me with the following problem that is occuring.
The thing is that every now and again a computer of mine, gives a message that the computer has run out of resources. So the thing is, is there any way I can handle such an event in VC++. When I try to connect to that PC throught PC Anywhere, I can't because of this message.
Can anyone help???
Thank you in advance
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|