|
includeh10 wrote: How to recover the damaged file?
You can't. Just delete the file and let it get rebuilt.
"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
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
hi,
Everybody,
i am trying to use parallel port to send data to it using vc++, i have added LED's to know if it works fine.
I have included inpout32.dll in my system32 directory and inpout32.lib is linked to my project, i have even placed inpout32.dll at my projects directory.
When the project executes, it gives no error, but output doesnot appear at LEDs.
please let me know if there are any errors in my code below, or anything that can help me to see output
#include <conio.h>
#include <stdio.h>
void _stdcall Out32(short PortAddress, short data);
int main () {
Out32(0x378, 255);
printf("DTA SENT");
return 0;
}
|
|
|
|
|
Never having used Out32()... Have you verified that 0x378 is the correct address of the parallel port on your machine (and it is enabled)? Have you ruled out hardware problems, LED's that are backwards, ground(s) not connected...
|
|
|
|
|
Yes jeron
I have made sure all about that, port is enabled, adress is 0x378,
that is only why i am getting nuts. i just cant figure out what is wrong and where is it wrong
|
|
|
|
|
|
Thanx It worked
|
|
|
|
|
Hi all,
I would like to use STL <numeric> adjacent_difference function in my program but I'm getting the error:
1>c:\program files\microsoft visual studio 8\vc\include\numeric(349) : error C2440: '=' : cannot convert from 'Csimple' to 'int'
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called.
I have a <list> of Csimple's (udt) objects where I would calculate the differences (Csimple is a very simple class with only one int parameter called "firstInt").
list<Csimple> simpleList;
simpleList.push_back(Csimple(10));
...
simpleList.push_back(Csimple(25));
vector<int> res(simpleList.size());
vector<int>::iterator v_resItr;
v_resItr = adjacent_difference(simpleList.begin(), simpleList.end(), res.begin());
I've also added the overloaded version of operator- and operator= as class members as suggest by errors provided by compiler
Csimple Csimple::operator -(Csimple op2)
{ return firstInt - op2.firstInt; }
Csimple Csimple::operator =(Csimple op2)
{ return firstInt = op2.firstInt; }
I assume that I can use adjacent_difference also with user-defined type rather than just int; may be my assumption wrong?
Can someone help me, pls?
Many thanks in advance
modified on Friday, April 2, 2010 7:42 AM
|
|
|
|
|
Try to add an operator to your class :
...
public:
operator int() { return firstInt; };
...
(please see the file of the error:
for (*_Dest = _Val; ++_First != _Last; ) )
virtual void BeHappy() = 0;
modified on Friday, April 2, 2010 9:00 AM
|
|
|
|
|
Hi Eugen, your suggestion worked very well
many thanks again
|
|
|
|
|
We have a window that displays a 2D grid, consisting of points connected by lines to form a rectangular network. The outline is irregular, and the point spacing may vary slightly. This represents an array of shots taken during a geophysical survey. The problem is that for a typical grid from a marine survey the rendering is rather slow, and when the user zooms in or out they must wait several seconds for the screen to update which is not good. Also if the user moves the window, the redraw takes several seconds, which looks a bit crap. Does anyone know if using DirectX would produce faster rendering? If so, what sort of performance gain would we see? Incidentally I assume DirectX 9 as we need to maintain compatibility with Windows XP, if not Win2K.
|
|
|
|
|
unless you have a very large number of points (and/or do a lot of calculations on those points), you should no have that much of an issue with performance even when using straight GDI.
Can you share with us how you display those points ?
Watched code never compiles.
|
|
|
|
|
Maximilien wrote: Can you share with us how you display those points ?
We simply use GDI calls such as LineTo and also for each point there is optionally a label that is output using TextOut or whatever. We do have an issue with performance because of the large number of points. Land surveys are fine, as there are only 100's or even 1000's of points. Marine surveys have maybe 100's of 1000's of points.
|
|
|
|
|
That sounds like something you could do fairly easily in DirectX. This[^] is a useful starting point, and should give you some idea of what is involved.
|
|
|
|
|
Graham Breach wrote: That sounds like something you could do fairly easily in DirectX. This[^] is a useful starting point, and should give you some idea of what is involved.
Thanks.
|
|
|
|
|
It sounds like you're doing this pretty inefficiently.
Have a look at PolyPolyLine. With a combination of that and SetViewportxxx functions, you could zoom and pan quite speedily.
Have a look at:
The ViewPort Explorer[^]
Also, no need to draw text for every point unless there's only a few. Maybe hover a tooltip where the mouse is? Otherwise, you could be doing a LOT of text rendering...
DirectX is always a possibility, but a lot harder...
Do you have some horrible inefficent loops? ie,
for (n = 0; n < pMyLongLinkedList->GetSize (); n++)
{
pMyLongLinkedList->GetNthMember ()->DoStuff ();
]
etc.
Iain.
I have now moved to Sweden for love (awwww).
|
|
|
|
|
Iain Clarke, Warrior Programmer wrote:
Do you have some horrible inefficent loops? ie,
for (n = 0; n < pMyLongLinkedList->GetSize (); n++)
{
pMyLongLinkedList->GetNthMember ()->DoStuff ();
]
No there's nothing stupid like that. It is the sheer number of GDI calls that is the issue. (It is not my code, but it is decent.)
|
|
|
|
|
Iain Clarke, Warrior Programmer wrote: It sounds like you're doing this pretty inefficiently.
Have a look at PolyPolyLine. With a combination of that and SetViewportxxx functions, you could zoom and pan quite speedily.
Have a look at:
The ViewPort Explorer[^]
I'm familiar with viewports. But that is a good point, that the code (not written by me) might be scaling distances without needing to.
|
|
|
|
|
No directX is required.
Use memory DC first, then show memory to visible DC.
|
|
|
|
|
yes and no, sometimes, just computing the points positions (and other attributes) can take a long time, especially with thousands of points.
but good point anyway.
Watched code never compiles.
|
|
|
|
|
There must be something strange in your code. I have an application that draws 2000-4000 lines using pure GDI. It's ready in less then 0.5 seconds, on an outdated laptop.
|
|
|
|
|
Rozis wrote: There must be something strange in your code. I have an application that draws 2000-4000 lines using pure GDI. It's ready in less then 0.5 seconds, on an outdated laptop.
We have far more lines than that. Lines are drawn between each adjacent point. (Some speed gain can be had by pretending that some points lie on the same line.)
|
|
|
|
|
Any body having idea abut the usage of dia2Dump SDK? It shows everything if we study its code.
I need some limited info from it which I desired.
Regards
Usman
|
|
|
|
|
Not too difficult to find if you use the tools that are available: Google[^].
It's time for a new signature.
|
|
|
|
|
yeah I found this one and I got my task nearly done. Only thing remains as referenced DIA2Dump is , it actually shows everything(ALL KERNEL related symbols, Os Symbols when I give it PDB which I dont need) I only need my symbols which is defined in my DLL/EXE/PDB. like I have some DLL in which some symbols are symbol001(int x,int y) & then symbol002(int x3,int x4)... I only need these 2 not everything starting from Kernal level imports and sky is the limit
AS I used get_symbolsFileName by which I can trace symbols from where they come. But its failing and not populating me any info regarding symbol file like xyz.obj or any other file from which those symbols come. So that I can filter my symbols which I desired some how by this way
|
|
|
|
|
From what I could see this is a skeleton piece of source code for you to use and modify as you require, but I doubt that Microsoft will offer much in the way of support. As with so many things you may be the first person to use this, so you become the expert ...
[edit]I also notice that someone downvoted your original question, which may mean that someone (or more than one) does not want this subject discussed here; yeah I know, strange folk around. Good luck anyway.[/edit]
It's time for a new signature.
|
|
|
|