|
I want the way how can we learn these ways
I have some knowledge about plc languages but didn't know about the C,C++,asemly language too.
Please help me the way I can understand
|
|
|
|
|
Like I said, you first need to understand the format of the "hex" (whatever that means) file. You also need to understand exactly what it is you want to convert it into.
And without a lot more information it is impossible to make any better suggestions.
|
|
|
|
|
This is an example of what you're in for.
Get any HEX editor, like HxD[^], and install it. Now go grab the Notepad.exe file from C:\Windows and open it in the hex editor.
Now you're looking at a whole of bunch of bytes that make up the content of the file, and you need documentation to tell you what every one of those bytes means. You're going to start here[^] to figure that out.
Oh, and when you get to actual executable code, you're going to have to understand the Intel instruction set, all the addressing modes, and the operands each instruction requires. All of that is in the bytes that make up the executable code. Notice, you're not going to get back C/C++ code. You're getting back assembly code.
Once you're brain melts from trying to understand all that, now you have to do that same thing for the .hex file you're looking at for your PLC's. Oh, and you'll need all the relevant documentation similar to this example of disassembling Notepad.
Do you get it now?
|
|
|
|
|
Do you mean Intel HEX - Wikipedia[^] ?
That is pretty straightforward.
Using it for creating a 'plc language' or a 'program in plc language' is a bit obscure, as far as I can understand.
"In testa che avete, Signor di Ceprano?"
-- Rigoletto
|
|
|
|
|
Message Closed
modified 15-May-23 19:06pm.
|
|
|
|
|
This is not a C++ question, basic or otherwise. It is a QT question. You will probably get a better answer from a QT specific forum.
Keep Calm and Carry On
|
|
|
|
|
Message Closed
modified 15-May-23 19:06pm.
|
|
|
|
|
It's the constructor of a class called MainWindow . QMainWindow and ui are being initialized using an initialization list.
"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
|
|
|
|
|
It is a single parameter constructor of the MainWindow class. The constructor accepts a single parameter which is a pointer to a QWidget object. The constructor sets its QMainWindow property to the input parameter - in this case the pointer named parent . It then sets its ui property by calling the Ui::MainWindow constructor, to create a new object of that class. To find out what the latter returns you need to look at the Ui class documentation.
|
|
|
|
|
Message Closed
modified 2-Oct-22 15:46pm.
|
|
|
|
|
|
Member 14968771 wrote: I need some help implementing xterm...
I'm not sure what you're asking. There's plenty of xterm implementations, and almost all of them will be better than anything you or I or most others here could write. There's even a QT Terminal widget:
GitHub - lxqt/qtermwidget: The terminal widget for QTerminal
But maybe you don't want to actually implement a terminal application? In which case, either I've misunderstood your query, or you need to reframe your question to better reflect what it is you are trying to do.
Keep Calm and Carry On
|
|
|
|
|
typedef struct {
int s1;
int s2;
int s3
}strTst;
strTst spst1 = {3,5,7};
strTst spst2 = {1,2,4};
strTst *Sp1[2] =
{
&spst1,
&spst2
};
strTst *pt = &Sp1;
I wonder how can i use pt to get a value in spst2, I checked,
(*pt) value = &spst1, *(pt+1) = &spst2.
but the compiler not let me to use (*pt)->s1, or ( (strTst *)(*pt) )->s1
modified 11-Sep-22 18:10pm.
|
|
|
|
|
The last line won't compile: Sp1 is an array of 2 pointers to strTst instances, not a strTst* . To access s1 in spst2 , you need
strTst *pt = Sp1[1];
pt->s1 = 0;
|
|
|
|
|
it's compiled, but with a warning, incompatible pointer types Initializating
|
|
|
|
|
Can I cast the strTst* pt to an array of 2 pointers to strTst instance?
with
strTst *pt = &Sp1; although, there is a warning compiler issued.
I get the address of the Sp1 array.
I think since i get the address of a data object,then i can operate on the data object.
|
|
|
|
|
A cast should only be used when necessary, which isn't the case here.
EDIT: I'm compiling under C++, so maybe it's an error there, and only a warning in C.
|
|
|
|
|
How about this:
typedef struct {
int s1;
int s2;
int s3;
}strTst;
strTst spst1 = { 3,5,7 };
strTst spst2 = { 1,2,4 };
strTst* Sp1[2] =
{
&spst1,
&spst2
};
strTst** pt = Sp1;
void f () {
pt[1]->s1 = 0;
}
Mircea
|
|
|
|
|
You have declared Sp1 to be an array of pointers, each of which points to a strTst structure. So to get one of the pointers you just need normal array addressing, e.g. Sp1[1] returns the second element of the array. So all you need is:
strTst *pt = Sp1[1]; int value = pt->s2;
|
|
|
|
|
strTst *pt = Sp1[0];
pt->s1;
pt->s2;
pt->s3;
pt = Sp1[1];
pt->s1;
pt->s2;
pt->s3;
strTst **ppt = Sp1;
ppt[0]->s1;
ppt[0]->s2;
ppt[0]->s3;
ppt[1]->s1;
ppt[1]->s2;
ppt[1]->s3;
|
|
|
|
|
Hello everybody!
My working environment is: Windows 10, Visual Studio Community 2017 (and 2008 for older projects), programming takes place only in C/C++.
I need my program to be able to send emails with a PDF file attachment. The easiest way to send emails is to use ShellExecute with the parameter "mailto:someone@mail.com ... etc". But this method does not allow you to transfer attachments.
So I tried using MAPISendMail in a variety of variants found on the internet. Including Programmatically adding attachments to emails and many others. Almost all of them work fine on my computer.
However, when I trying to send an email on another computer, it leads to an error in the MAPISendMail function MAPI_E_NOT_SUPPORTED (code 26). In this case, the MAPILogon(Ex) function is executed without errors. Both computers, mine and the other, are on the same network and use the same mail server and Outlook as the client for users. On the other computer send/receive of the emails works perfectly. I searched the Internet for a long time for an explanation of this error, but found nothing. A search on the site CodeProject also did not give anything.
Please explain me what this error means and how to fix it. Thank you very much!
|
|
|
|
|
You need to examine the code that causes the error. That should give a clue as to why it occurs.
|
|
|
|
|
One of the simplest variants I taked from Sending Email with MAPI, "Attachment" example. It works perfectly on my computer, but cannot send email on other.
My send mail code fragment is:
LHANDLE lhSession;
ULONG result = lpfnMAPILogOn(0, NULL, NULL, 0, 0, &lhSession);
ULONG nSent = lpfnMAPISendMail(lhSession, 0, &MAPImsg, MAPI_LOGON_UI | MAPI_DIALOG, 0);
lpfnMAPILogOff(lhSession, 0, 0, 0);
Variable result is OK, but nSent is MAPI_E_NOT_SUPPORTED (code 26).
Complete example project there: Probe3.7z - Google Drive.
|
|
|
|
|
The issue is that some parameter that is in that SendMail call is incorrect according to the client or server that is handling the request. But there is no way anyone here can tell which it is. You need to capture more information somehow.
|
|
|
|
|
We had similar problems (sending e-mails with attachments). But since all our customers use MS Outlook as a standard e-mail application, we just implemented the Outlook automation. So the problem was solved.
|
|
|
|