|
hi
how add event handler for CTreectrl * m_treectrl;
m_treectrl->creat(......);
m_treectrl->insertitem(....);
|
|
|
|
|
|
There are some great articles here on CodeProject - Tree Controls[^]
Be sure to pick the ones written in C++.
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
|
|
|
|
|
#import <somedll.dll> no_namespace
Whats is the meaning of the above line?
Thanks,
|
|
|
|
|
|
It was always a good practice to first search for the answer in the documentation, which is in that case (Microsoft) just MSDN!
if not found or not understood - then welcome to this or/and many other Forums with the extended info what exactly was not understood:
#import Directive (C++) | Microsoft Docs
modified 28-Jun-18 14:57pm.
|
|
|
|
|
This is a COM (Component Object Model) thing.
Basically the COM runtime takes type library information embedded in the COM DLL and creates headers and helper methods including some exception handling so that client C++ programs can call into the DLL.
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
|
|
|
|
|
AnyOne Please Guide Me on my This Error <
"Stack around the variable 'Student' was corrupted."
I Receives it when I copy Members of Structure "StudentInfo" into Structure "FailStudents"
using
list[i].FullName = Student[i].FullName ;
list[i].RollNo = Student[i].RollNo;
Here list is Structure Variable of Structure "FailStudents" and Student is Structure Variable of Structure "StudentInfo"
#include<iostream>
#include<string>
using namespace std;
const int No_Of_Students = 5;
void main()
{
struct StudentInfo
{
int RollNo;
string FullName;
int marks[2];
};
StudentInfo Student[No_Of_Students];
struct FailStudents
{
int RollNo;
string FullName;
int marks[2];
};
FailStudents list[No_Of_Students];
int NoOfFailStudents = 0;
for (int i = 0; i < No_Of_Students; i++)
{
cout << "Enter Student NO " << i + 1 << \" FullName : \t";
cin >> Student[i].FullName;
cout << "Enter Student NO " << i + 1 << " Roll Number : \t";
cin >> Student[i].RollNo;
int failSubjects = 0;
for (int k = 0; k <= 2; k++) {
cout << "Enter Student NO " << i + 1 << " Subject " << k + 1 << " Marks : \t";
cin >> Student[i].marks[k];
if ((Student[i].marks[k]) < 40)
{
failSubjects++;
}
}
if (failSubjects > 1)
{
NoOfFailStudents++;
list[i].FullName = Student[i].FullName;
list[i].RollNo = Student[i].RollNo;
cout << "Student Name "<< list[i].FullName << "is fail"<< endl;
cout << "Having Rol Number " << list[i].RollNo << endl;
}
cout << "\n \n ";
}
system("pause");
}
|
|
|
|
|
You have declared marks as a 2 element array, but your loop runs 3 times.
for (int k = 0; k <= 2; k++) { cout << "Enter Student NO " << i + 1 << " Subject " << k + 1 << " Marks : \t";
cin >> Student[i].marks[k];
if ((Student[i].marks[k]) < 40)
{
failSubjects++;
}
}
It should be:
for (int k = 0; k < 2; k++) {
|
|
|
|
|
Hi
Can any one help me convert the C++ code to python
<pre lang="c++">char buf[1024];
int nBufLen1;
CString sendBuffer("$Magic $Command AudienceCount 0 10000");
buf[0] = 0;
buf[1] = 0;
WORD len = sendBuffer.GetLength() * 2;
nBufLen1 = len + 5;
buf[2] = (BYTE)len;
char *pStr = T2A(sendBuffer);
strncpy(&buf[3],pStr,len);
buf[len + 3] = 0;
buf[len + 4] = 0;
if(sock.Send (&buf,nBufLen1) != nBufLen1)
{
OutputDebugString(L"Socket Send Failed");
return FALSE;
}
I have a MFC C++ server(with CArchive) (serialization used) to which I need to send the data over socket.
The above code works in C++ client, need to replicate same in python so that it might work.
What I have tried:
I have been trying to use seasnake, but unable to install using pip.
A few online converter are also there, but many are not working.
|
|
|
|
|
|
How to call a 'C' program function from VB code?
Thanks
Nice things do nice works
|
|
|
|
|
|
Can you please show some examples ?
Thanks,
Nice things do nice works
|
|
|
|
|
So which part do you need help with: creating an exported function in C, or using said function in VB?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
both parts (full sample program)
Thanks,
|
|
|
|
|
Read point #2 here.
As to how to export a function from a DLL, see here.
For declaring a reference to an external function in a DLL, see here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles
|
|
|
|
|
Hi,
There is a really old article from 2005[^] that demonstrates how to do this. If you scroll to the bottom of the forum you might find a younger Randor lurking there. His username wasn't even red like a rooster yet.
Best Wishes,
-David Delaune
|
|
|
|
|
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
|
|
|
|
|
Hi I have Dialog based mfc applciation using visual studio 2013.
Dialog contains multiple controls. It has two threads - main ui thread and worker thread
In a particular control (some static test) i have to show some counts (like number of Cars produced
and Number of Bikes prodcued, and total ). Actually these counts are given by worker thread.
Worker thread continuously gives the counts (that is live data)
I have to update UI from main thread based on these data lively.
Please help me to design this use case. My ui contains multiple controls. I don't want to block the UI
How to pass the data(counts) from worker thread to main thread? how to avoid block in main thread?
Is there any need for queue or another thread?
That is UI will be some thing like
number of Cars produced:10
number of Bikes produced: 20
Total: 30
|
|
|
|
|
Member 11426624 wrote: Is there any need for queue or another thread?
No, you could just use the PostMessage function[^] from the worker thread to pass a custom window message[^] to the UI thread to update the counts and that would be non-blocking.
Best Wishes,
-David Delaune
|
|
|
|
|
|
I'm using Visual C++ Professional Version 2015 update 3. I have a program that automates Excel and works fine in our Windows 7 computers. However, on Windows 10, Excel doesn't even launch (CreateDispatch() returns 0).
There is a problem with a Windows Function, CLSIDFromProgID(L"Excel.Application", &clsid), which returns error 0x800401fe, which has the explanation: “Application was launched but it didn't register a class factory”. This is a curious explanation because all the function does is pick up the CLSID from the registry (it doesn’t launch Excel). And “Excel.Application” is in the registry for the Windows 10 computer just like for our Windows 7 computers. I was thinking that maybe Windows 10 doesn’t allow automation to work from clients that are from an “unknown publisher”, but then it should work with UAC off. (And when I ran it with UAC set to "never notify", the warning message did not appear when starting PI_Dats. Maybe it’s not really disabled, it just doesn’t issue the warning?)
On the Local Disk Properties Security tab, Administrators have full control and I set Users also to full control. Any ideas on how to automate Excel from Windows 10 would be greatly appreciated.
Thanks,
Gary
|
|
|
|
|
|