|
If you want to use other languages see this[^] I think its helpfuls
|
|
|
|
|
heyhey
wow, I love this forum! hopefully someone can help with my question:
I, like many else, try to write a stable math library in VC++.
unfortunately my vector struct makes some trouble so here's the code:
...
__declspec(align(16)) union vector4{<br />
__m128 m128;<br />
struct { <br />
float x,y,z,w;<br />
};<br />
float f[4];<br />
};<br />
<br />
...<br />
int main()<br />
{<br />
vector4 a;<br />
a.x = 1.0f; a.y = 0.0; a.z = 0.0; a.w = 1.0;<br />
vector4 b = {1.0f, 0.0f, 0.0f, 1.0f};<br />
a.f[0] = 1.0f; a.f[1] = 0.0f; a.f[2] = 0.0f; a.f[3] = 1.0f;<br />
return 0;<br />
}<br />
any of those lines work fine but on exiting I get a
"Unbehandelte Ausnahme bei 0x004117a7 in MatheFunktionen.exe: 0xC0000005: Zugriffsverletzung beim Lesen an Position 0x00000800."
<=>
"unhandled exception at0x004117a7 in MathFunctions.exe: 0xC0000005: Access violation while reading at position 0x00000800."
Removing the declarations a = ... a.x =... and stuff solves the problem. Do I have to free the memory of a before quitting?
I'm using Visual Studio 2005 8.0.50727.42
any help is apprecitated
zqueezy
PS: I already googled and searched the forum but couldn't find a solution, so links would be appreciated, too
|
|
|
|
|
No I changed it to :
<br />
__declspec(align(16)) struct vector4{ <br />
float x,y,z,w; <br />
};<br />
and still fails, the error seems to lay within the
__declspec(align(16))
cause when it's removed it works
Windows XP: For some it's an OS - for others the longest virus of the world
|
|
|
|
|
zqueezy wrote: Do I have to free the memory of a before quitting?
No, you dont have to.
I'm able to run this code without any error. Is something other you are trying , than mentioned here.
BTW, hope you have read this MSDN line The __m128 data type is not supported on Itanium Processor Family (IPF) processors.
|
|
|
|
|
hm, yeah you're right...
somehow the cpuid-test whether sse exists failed before but didn't throw an exception when run alone.
When I declared my vector and run the prog as said it failed at the end somehow.
whatever I changed my sse-test (not pure asm) and it worked. Thanx anyways!!!
|
|
|
|
|
Most welcome !
|
|
|
|
|
Hi everybody,
Can u please say How can we calculate the CPU time taken by a thread and a process.
Thanks in advance,
|
|
|
|
|
Is GetProcessTimes helpfuls?if no and you want a good example you find your answer on examples of MSDN If I remember its name is PVIEWER(not sure) but its very good example you can see detaily of each process that is detailed but also you can see a good example on the codeproject of David Crow here[^]
|
|
|
|
|
Thank you very much Whitesky.
I wish you a happy new year.
|
|
|
|
|
Thank you and you tee ,but its early new year is on April in my counry
|
|
|
|
|
|
|
how to open a query with just 3 columns? .my database contains 40 i think more... and when i try to update i have this error: SQL: Statement too long, because this is my statement:
SELECT `cont`,`den`,`tip`,`fel`,`listare`,`carte`,`formular`,`rand`,`inchid`,`sid0`,`sid1`,`sid2`,`sid3`,`sid4`,`sid5`,`sid6`,`sid7`,`sid8`,`sid9`,`sid10`,`sid11`,`sid12`,`sid13`,`sic0`,`sic1`,`sic2`,`sic3`,`sic4`,`sic5`,`sic6`,`sic7`,`sic8`,`sic9`,`sic10`,`sic11`,`sic12`,`sic13`,`rld1`,`rld2`,`rld3`,`rld4`,`rld5`,`rld6`,`rld7`,`rld8`,`rld9`,`rld10`,`rld11`,`rld12`,`rlc1`,`rlc2`,`rlc3`,`rlc4`,`rlc5`,`rlc6`,`rlc7`,`rlc8`,`rlc9`,`rlc10`,`rlc11`,`rlc12`,`rcd0`,`rcd1`,`rcd2`,`rcd3`,`rcd4`,`rcd5`,`rcd6`,`rcd7`,`rcd8`,`rcd9`,`rcd10`,`rcd11`,`rcd12`,`rcc0`,`rcc1`,`rcc2`,`rcc3`,`rcc4`,`rcc5`,`rcc6`,`rcc7`,`rcc8`,`rcc9`,`rcc10`,`rcc11`,`rcc12`,`obs`,`codfiscal`,`fact`,`data_fact`,`data_scad`,`mag`,`rata`,`marca`,`verificat`,`i0`,`i1`,`i2`,`i3`,`i4`,`i5`,`i6`,`i7`,`i8`,`i9`,`i10`,`i11`,`i12`,`sold_vechi`,`sold_nou`,`l`,`curs_ini`,`data_curs`,`moneda`,`cont_conv`,`val_conv`,`curs_ref`,`r1`,`r2`,`r3`,`r4`,`r5`,`r6`,`r7`,`r8`,`r9`,`r10`,`r11`,`r12`,`nr_rate_r`,`tva`,`inceput`,`terminat`,`curs_fin`,`s_v_ini`,`bi`,`v_tva` FROM `2006tert` WHERE fact=1978
how to write an sql statement when i try to open
CString sQLW = ("SELECT................ what?
CDatabase_ALS pRo;
pRo.Open(CDatabase_ALS::snapshot,sQLW);
this statement it came from this CString sX = pRo.GetSQL();
m_lop.SetWindowText(sX);
and this i have seen my select statement because i dont write it!
all i want is to edit a field from cont !
???????????????????????????????????????????????????????
Bravoone
|
|
|
|
|
Use a stored procedure perhaps ?
|
|
|
|
|
if you want to read some cols you can simply enter names of cols Select col1,col2,col3 from table1
|
|
|
|
|
sQL =("SELECT cont,codfiscal,fact FROM 2006tert");
using this i have this rezult :
Invalid descriptor index!!!!!!!!!!!!!!!!!!!
what can i do?
-- modified at 7:53 Thursday 4th January, 2007
Bravoone
|
|
|
|
|
|
Is this link helpful
http://www.codeguru.com/forum/showthread.php?p=1459845#post1459845
|
|
|
|
|
What is CDatabase_ALS derived from? CRecordset?
If so then check the class. Is there a DoFieldExchange override? If so, is it exchanging more
fields than the three you want? If so, then that's a problem
|
|
|
|
|
I want to get text data from another program by this function.
::SendMessage(hwnd,WM_GETTEXT,0,(LPARAM)pchData)
So,I need hwnd of destination Edit Ctrl, but I don't know how to get it.
Please help me to solve this problem
|
|
|
|
|
If you have the handle of the parent window, then you can use EnumChildWindows to search for the EDIT one.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
If the target application is always the same, you may use Spy++ to identify your editbox.
Otherwise, ChildEnumWindow is a possibility, but then you will need another way to check if the returned handles are really these you awaited (maybe IsKindOf ?)
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb
|
|
|
|
|
I think your answer is EnumDesktopWindows
|
|
|
|
|
If what you need is to retrieve the content of an edit control from another application, you can't. GetWindowText can retrieve only a caption (if any) from a window owned by another process.
Since an edit control does not have a caption, you'll retrieve a null string. Otherwise, one could easily read a password from a password edit control.
It could be possible to use an injection in the process, using VirtualAlloc and VirtualProtect, inject code in the target executable, allocate a buffer in the other executable' space, call there the WM_GETTEXT (in that exe) and then pass back to your exe the content of the buffer (IPC, MapViewOfFile, your choice). This is the way to retrieve, for example, the content of a listview (a lot of times I saw people asking how to read the content of OE list). I don't know the technique in detail, I just saw it once - but I think you have already the information to start looking for. Good luck.
|
|
|
|
|
How would I get the full path of where an application is saved and started from in a C++ application??
|
|
|
|
|