|
prithaa wrote: But can I give a width beforehand...
Before what?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Can you give some real font example that is not performing as expected?
I think there is a difference in measuring different types of fonts.
|
|
|
|
|
Hi,
Am getting data from the serialport, when i call MComm->Getinput function to get the data from serial port, the data is stored in Variant type of data(result).I want to store this data in a safearray how to do that.
VARIANT CMSComm::GetInput()
{
VARIANT result;
InvokeHelper(0x1a, DISPATCH_PROPERTYGET, VT_VARIANT, (void*)&result, NULL);
unsigned int i;
HRESULT hresult;
VARIANT var;
SAFEARRAY * psa;
SAFEARRAYBOUND rgsabound[1];
VARIANT *pData;
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = 10;
psa = SafeArrayCreate(VT_BSTR, 1, rgsabound);
var.vt=VT_ARRAY|VT_BSTR;
SafeArrayAccessData(psa, (void HUGEP**)&pData);
pData= result; // error:am not able to assign like this
var.parray=psa;
return var;
}
Thnaks
|
|
|
|
|
I'm no COM expert, but isn't there a way to get the Variant to collapse to a BSTR? Then store that in your array.
Just split the problem in two, and you have solvable bits.
Iain.
|
|
|
|
|
Your immediate problem would seem to be the need to use
<br />
*pData = result;<br />
not that just changing that is going to make your code work.
More generally if you're getting unparsed binary data in a VARIANT from a COM object isn't it already in a SafeArray?
Check the type of the VARIANT and the contents of its array members. I suspect you'll find the VARIANT already is a SafeArray just disguised for COM/OLE Automation correctness.
If not then I would do everything possible to keep the data away from SafeArrays which are code bloaty and awkward unless you're forced to interact with classic VB in which case they're also essential. Good luck.
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Hello all's
I am working in VC++ from last some time . I have study it myself also
can any one told me any link for interview question for MFC for 0-2 year exp.
Note : i know its very basic question but i am start from Basic.
Regard's
Kaushik
|
|
|
|
|
Y_Kaushik wrote: : i know its very basic question but i am start from Basic.
Do you want to start to learn?
|
|
|
|
|
If you start to teach i can start
Regard's
Kaushik
|
|
|
|
|
I can help you like a friend or a classmate but for teach you need a teacher.;)
|
|
|
|
|
Hello, I'm a beginner in C++ programming, and I have realized a little app showing the day's appointments, or birthdays; a calendar, shortly.
My app starts minimized in tray (I follow the accurate tutorials on this site), but I noticed that, differently from window minimized, system memory used is the same as the open window, in this case some MBs, while minimized my app uses only 600KBs.
Is there a trick to reduce memory usage in case of application running in tray? Or, the same, minimizing the window but at the same time moving it to tray? Thanks, Simone.
|
|
|
|
|
Hi,
What do u think is faster to compare a secuence of BYTES that can has [192, 4096] positions?
My boss did it with two BYTE BufferX[4096], one to hold the actual project code and the other to hold the PLC saved code in order to compare both of them on the fly. And he has said that he wants it to be done in another way because the performance was very slow.
The secuence of bytes has a logical strructure and I have already the code to write it in a file, I write using tokens of different length according to the meaning and the configuration of the actual project. And the Plc should have the same bytes in the same order.
I thought to make it using the functions I already have (and work) to create an "AktualProject.pc" and get the secuence of the PLC and create an "OnlineProject.pc". Then open both of them and compare byte per byte doing an iteration till the end of the files. When a difference come... error.
But a partner has told me it may be faster with DAO. Writing my the actual code to a row (or a column), the online code to another row (or column, I don't know what will be better) and then compare the contents of both using database requests.
What do you think it is better? My boss priority is quickness of the programm, but I have never used DAO before.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Nelek wrote: What do you think it is better?
It matters not what we think. What matters is the empirical data that you gather to appease them both. You can't use here-say when comparing metrics. Code up both ways so that you can confidently say which way performs better.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The problem is that I don't know about DAO. Because of that I have asked.
If DAO is faster then I will learn and try it, if more or less are the same, I can use what I already know and don't delay it more than strictly needed.
Anyways thanks for answering.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Nelek wrote: If DAO is faster...
Whether it is or isn't, you won't actually know until you code something up to test with. DAO may be faster in scenario A, but slower in scenario B.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hey guys,
Can anybody tell me how to create a dll that ca be successfully fully loaded in some other language like vb and can be used there.
Regards,
Pankaj Sachdeva
"There is no future lies in any job"
"but"
"future lies in the person who holds the job"
|
|
|
|
|
I have no idea (yet), I need to learn about DLLs too, So I was looking in the DLL section here in codeproject.
I think This link[^] and the other 3 articles of the same group can help you.
Is about writing a C++ from VC++ and VB. It has information about compatibilities and so on. Maybe is not what you exactly look for, but it has lot of comments/points tht will help you.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Have you tried to make a atl com dll
i have tried by i am unable to use it successfully
like some of the functions are working and some other are not do you have any idea
Regards,
Pankaj Sachdeva
"There is no future lies in any job"
"but"
"future lies in the person who holds the job"
|
|
|
|
|
no sorry, you are in a more advanced position as me at the moment
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
u will have to use "_stdcall" calling convention while exporting the function from DLL.
|
|
|
|
|
Hello,
In our application,there is one spinbuttoncntrl is used to increase or decrease the values. When I open the application, i can able to increase and decrease the value depending upon the default values like if default value is 8, i can able to increase from 3 to 5, 4 to 7 .
But when I close and open the application the spinbuttoncntrl is disabled. Please assist me how to solve this.
Thanks in advance
Ratheesh
|
|
|
|
|
I don't know if I understand everything, but your seems a problem related to a bad initialization of that control.
Enable it in the VS IDE or programmatically using CWnd::EnableWindow() or CWnd::ShowWindow(SW_SHOW)
Russell
|
|
|
|
|
Thanks for your response. In a property sheet contains 5 tabs. First tab is General, this tab has the spinbuttoncntrl. When I open the application at firsttime, it enables and can able to increase and decrease the values.
But if i close the application and open it again, it shown as disabled.
Note: The 2nd tab also contains 5 spinbuttoncontrols, there i made some changes like increase and decrease also it enabled all the times. How?
Please assist me to resolve this issue.
|
|
|
|
|
rajaratk wrote: When I open the application at firsttime, it enables and can able to increase and decrease the values.
But if i close the application and open it again, it shown as disabled.
This makes no sense. Why should one "open" be different than any other "open?" What are you doing when the application is opened? When that tab is activated?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
As David says, this makes no sense on its own.
Are you confusing Close / Open with Minimise / Maximise?
If not, then some action in your code is doing different things. Do you save values? Do a search in your code for the control ID of the spinbutton and see what you do with it.
Unless someone (ie, YOU) disables the control, it will be at whatever state it is set to be in the dialog resource. You need to track down where you disable it, and see why that is different in the two scenarios.
Iain.
|
|
|
|
|
Hello guyz,
I want to convert a CString to WCHAR but I don't know how to.
Can anybody help me with this?
Any comment will be much appreciated.
Thank you.
|
|
|
|