|
Thank you for replying,
The matter is that i am trying to read a data file. The company who wrote the file sent me a sample of how to read their file but the problem is that the sample is in c++ and my app is in vb.net
the data file sounds like that:
?
‰ L $100 CB 36772579 C $100 FB 49553858 B $100 FL 01935605 A $100 FB 63796061 A $100 FB 33316613 A $100 AB 665
The sample code is:
typedef struct tag_RawDataNoImage
{
// Default Data
char iTellerID[48];
char iTellerName[48];
char iWorkstationID[16];
char iCustomerName[48];
char iCustomerACNo[32];
char iCustomerAddr1[64];
char iCustomerAddr2[64];
char iCustomerIDNo[32];
// Counter Data
SYSTEMTIME iDateTime;
int iType; // 0:Dollar , 1:Euro
int iDenom[10];
int iUnit[10]; // Number of each denomination
int iTotalUnit; // Total Number of count
int iTotalAmount; // Amount of count
int iUVMG; // 0-None , 1-UV , 2-MG , 3-UV/MG
char iImgResult[MAX_ROW_COUNT][32];
} RawData;
int main(int argc, char* argv[])
{
unsigned int i;
CFile file;
DWORD iRawDataCount;
RawData data;
CString itemStr, dataStr;
int uIndex,fOfs;
if(argc < 2)
{
printf("please enter name of Raw file. ex: Day_08.log\n");
return 0;
}
if(!file.Open(argv[1], CFile::modeReadWrite ))
{
printf("File open error!!!\n");
return 0;
}
file.Read(&iRawDataCount, sizeof(DWORD));
file.Seek(sizeof(DWORD),CFile::begin);
for(i=0;i
|
|
|
|
|
Hey Guys
Having a picutre 'geographical map'
how can i know if the user has clicked inside the map or outside it
within or outside the boundry...
(the thing is that i dont want to allow the user to click outside the boudries
Regards
Regards
Ramy
|
|
|
|
|
look at the mousedown event. the e argument has 2 properties x,y you can check the numbers to make sure the mouse is within the picture by determining when the boundries stop--
ex: picture 400*300
if x > 10 andalso y > 10 andalso x < 400-10 andalso y < 300-10 then
' within
else
' boundry
end if
|
|
|
|
|
thx for answering
i havent tried thi yet
but i donu if it will work on a map- i mean the shape of the picture is not a sqaure or circle...
any way will try it
thx
Regards
Ramy
|
|
|
|
|
first thx for helping
i guess till now what u told me what s not succeeded
dont u think there is an method or function to determine boundaries ?
note the map(picture) is with black boundry and filled in white...
no other shapes or lines within the boundaries
thx
Regards
Ramy
|
|
|
|
|
charchabil03 wrote: dont u think there is an method or function to determine boundaries ?
The boundries of a image? No, there isn't. You have to supply those boundries yourself or code your own edge detection algorithm to figure them out.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: You have to supply those boundries yourself
How is that??
Dave Kreskowiak wrote: or code your own edge detection algorithm to figure them out.
any hint for that?
Regards
Ramy
|
|
|
|
|
Just like image maps in HTML, you have to draw the boundries of each "region" of the map that's clickable and check for mouse clicks inside those regions.
Read this[^] for an explanation of what an "image map" is and the concept behind it. You'll have to implement your own functionality to implement this since there is nothing in Windows Forms that will do it for you.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi,
can any one tell me how to create a button in the title bar. just like a minimise button in the title bar.
|
|
|
|
|
There is no support for this built into the .NET BCL. You'll have to create your own support for this from scratch.
Basically, you have to handle all the window messages releated to the non-client area of your form, including painting and non-client hit testing of mouse clicks to see if your button was clicked on. Overriding your form's WndProc method is how you accomplish this. Painting your button in the correct place and keeping it visible are NOT easy. You have to have an in-depth knowledge of how Windows works and window messages work and why. I haven't found any tutorial that explains this to beginners.
You can find an example of overriding WndProc here[^], but it doesn't go into any depth about what window messages you have to handle to pull off what you want to do.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
Does anyone know of a good site which explains how to get use popup messages in vb.net? Hopefull one which doesn't involve javascript. If the only way is through javascript, then so be it.
Please help. Thank you.
|
|
|
|
|
Your reference to jscript makes me assume you're doing ASP.NET. In which case, jscript is it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You are correct. I am using asp.net in VB. Seeing as, according to your reply, the solution is thru javascript, do you know of any good sites I can learn from? Just for the popup message boxes (for now).
Thanks for the reply.
|
|
|
|
|
hi,
can any one help vb6.0 should send emails without using outlook or sqlserver
tx
|
|
|
|
|
How does SQL Server factor into it ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
google "cdosys" you can create an object to send email (you need an email system to send the request through however, it won't do it on it's own)
|
|
|
|
|
when i used smtp.gmail.com it is giving an error STARTSLL some thing like that
can any one help me
|
|
|
|
|
Dear friends!
actually i am trying to create a login form which should load b4 or after logon in the windows,thery validating users r allowed to access the system.
I want to implement this using windows services!
pls Guide me.
thanks
sezhi
|
|
|
|
|
By system do you mean:
1) the computer/network? -- wouldn't windows already take care of that?
2) some kind of application? -- you could make it easy on the user and grab the logged in user id and use that to authenticate access to the application.
|
|
|
|
|
Windows already does this on its own. It also will NOT let a user switch desktops unless they logon to the system first, thereby defeating ability to even SHOW a desktop, let alone get input on it.
What are you REALLY trying to do with this?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i draw a line chart on form in a picture box as i need to move these line further.
i need to get all the points(xy) coordinates of the line.
can anyone helps.any help or suggestion greatly appriciated
thanks.
-- modified at 1:45 Thursday 14th December, 2006
amolk
|
|
|
|
|
As soon as you want to do anything more than show a picture, you should ditch the picture box and handle your own paint event.
To get the co-ordinates along a line, work out the rate of ascent in one direction, then use fixed values in the other direction to work out your co-ordinates. So if you have a line from 10, 30 to 200, 150, your rate of ascent is (200-10)/(150-30) or 190/120. In other words, for every 19 pixels in the X, you travel 12 in the y. 19/12 = 1.583. So, to calculate your Y, multiple your X by 1.583, after normalising ( subtracting 10 and 30 so you start at 0 ).
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hello all,
am creating an application using vs.net2005 and sql server as a backend and vb as my code begin. my problem is am setting eno as a primary key field in that field an user entered a number which is alreay in the database it was shown some msg(that no is in the database please choose different no) am writing code for thi. but it is not working propherly. cause when ever user enter no it was check that condition and the clear again he put the same no in the text it was not show that message. am attaching my code. please help me to solve the issue....
Private Sub txteno_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles txteno.Leave
con.Open()
Dim A As Integer
A = txteno.Text
str = "select eno from empl"
cmd = New OdbcCommand(str, con)
While Not rs.EOF
'If (A = rs.getvalue("eno")) Then
If (A = rs.Fields(0).Value) Then
MsgBox("Eno Already in DataBase so Please select Different No")
txteno.Text = ""
End If
rs.MoveNext()
End While
con.Close()
End Sub
|
|
|
|
|
1) you can bypass the while loop by putting the value of the textbox in the where clause of the select statement
str = "select eno from empl where eno=" & cint(txteno.text)
if not rs.eof then it exists -- msgbox
2) where did rs get set, your code doesn't specify?
|
|
|
|
|
is there any way to identify that the process is being close by task manager? (not in the application tab but in the process tab)
im using the formclosed event of the form but it doest work..
Private Sub frmMain_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
Select Case e.CloseReason
Case CloseReason.ApplicationExitCall
MsgBox("Notify")
Case CloseReason.FormOwnerClosing
MsgBox("Notify")
Case CloseReason.MdiFormClosing
MsgBox("Notify")
Case CloseReason.None
MsgBox("Notify")
Case CloseReason.TaskManagerClosing
MsgBox("Notify")
Case CloseReason.UserClosing
MsgBox("Notify")
Case CloseReason.WindowsShutDown
MsgBox("Notify")
End Select
but it doesnt work when i closed the form in process tab(Task Manager)..
-- modified at 1:57 Thursday 14th December, 2006
|
|
|
|