換台電腦後 找不到.dll模組的錯誤警告:
使用Visual C++ 2010 產生win32 dll檔 給vb2010 引用 , 在裝有開發環境visual IDE下跑 可以正常呼叫dll 內的函數
但是把vb2010產生的執行檔和 dll 拿到另一台沒裝 visual IDE 的電腦
無論是xp or win7 都會出現 找不到.dll模組的錯誤警告
除了注意執行檔要跟呼叫的dll放在同目錄下以外
另有一點需要特別注意
在編譯C dll 的時候 , 預設會產生動態dll , (檔案較小)
如果遇到以上問題, 可以在編譯C dll的時候 設定為產生靜態dll (檔案變大5倍!!)
解決方法:
會發生這個問題的原因是因為當選擇編譯native win32程式的時候,VC2005是預設動態連結.dll函數庫,這個函數庫是要安裝VC2005才會裝上去的,所以在沒有安裝VC2005的電腦上您編譯的原生程式無法執行,這時我們選擇靜態連結函數庫即可解決這個問題。
作法是:
1.在專案上按右鍵,然後選properties。
2.看左側,打開C/C++折疊,選Code Generation。
3.之後看右邊的Runtime Library欄位,改選為靜態連結/MT(這個不包含debug資訊)或是/MTD(這個包含debug資訊)即可。
- Jul 10 Wed 2013 19:23
vb2010~換台電腦後 找不到.dll模組的錯誤警告 動態/靜態dll
- Jul 10 Wed 2013 00:28
vb2010~讀取.csv檔轉成DataTable, IO
Imports System.IO
Imports System.Data
Public Class Form2
Public Function getCSVtoDataTable(ByVal path As String) As DataTable
Dim dt As New DataTable()
Dim line As String = Nothing
Dim i As Integer = 0
Dim column_j As Integer = -6
Using sr As StreamReader = File.OpenText(path)
line = sr.ReadLine()
Do While line IsNot Nothing
Dim dataArray() As String = line.Split(",")
If dataArray.Length > 0 Then
'----- 為了在第一次產生column :only i=0----
If i = 0 Then
For Each item In dataArray 'N項 就先產生 N個column
dt.Columns.Add(New DataColumn(column_j.ToString))
column_j = column_j + 1
Next item
i += 1
End If
'----- /為了在第一次產生column :only i=0/----
Dim row As DataRow = dt.NewRow() ' 注意 Datarow 必須依附datatable 來新增 row
row.ItemArray = dataArray
dt.Rows.Add(row)
End If
line = sr.ReadLine() ' 對每一行row 處理
Loop
End Using
Return dt
End Function
Private Sub TabPage1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabPage1.Click
Dim table = New DataTable
Try
table = getCSVtoDataTable("c:\temp\t1.csv")
Catch ex As Exception
MsgBox(ex.ToString)
End Try
DataGridView1.DataSource = table
DataGridView1.AutoResizeColumns()
End Sub
Private Sub TabPage2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TabPage2.Click
Dim table = New DataTable
Try
table = getCSVtoDataTable("c:\temp\t2.csv")
Catch ex As Exception
MsgBox(ex.ToString)
End Try
DataGridView2.DataSource = table
DataGridView2.AutoResizeColumns()
End Sub
End Class
- Jul 08 Mon 2013 23:03
vb2010~傳一維/二維陣列給C dll使用,傳址呼叫
vb2010~傳"陣列"給C原生dll使用,傳址呼叫使用方法
注:vb 的 二維陣列宣告AA(x,y) 本質上與C 宣告二維陣列 AA[x][y] 是一樣的, 實質上都是連續的串接一維陣列!!
=============
Part A. (由C/C++ 產生dll , 非COM元件型動態dll)
=============
// dll.cpp : 定義 DLL 應用程式的匯出函式。
#include "stdafx.h"
#include
#include
//using namespace std;
extern "C"
{
__declspec(dllexport) void add(int a ,int b , float &c);
__declspec(dllexport) void add_array(int* data , int *c,int *d );
__declspec(dllexport) void add_array2D(int* data , int *c,int *d, int *e);
}
__declspec(dllexport) void add_array2D(int* data , int *c,int *d ,int *e)
{
*c= data[0];
*d= data[1];
*e= data[2];
}
__declspec(dllexport) void add_array(int* data , int *c,int *d)
{
*c= data[0];
*d= data[1];
}
__declspec(dllexport) void add(int a ,int b , float &c)
{
c= (float) a+b;
}
//==========================
PartB . (由 vb2010 重新引用 dll, 並對應傳址呼叫 傳陣列進出dll)
//================================
Imports System.Runtime.InteropServices
Public Class Form1
Public Declare Auto Sub ADD Lib "dll" Alias "add" (ByVal a As Integer, ByVal b As Integer, ByRef c As Single)
'__declspec(dllexport) void add_array(int* data , int *c,int *d );
Public Declare Auto Sub ADD_array Lib "dll" Alias "add_array" (ByRef data As Int32, ByRef c As Int32, ByRef d As
Int32)
'__declspec(dllexport) void add_array2D(int* data[] , int *c,int *d)
Public Declare Auto Sub ADD_array2D Lib "dll" Alias "add_array2D" (ByRef data As Int32, ByRef c As Int32, ByRef
d As Int32, ByRef e As Int32)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim c As Int32 = 0
Dim d As Int32 = 0
Dim ee As Int32 = 0
'ADD(11, 22, cc)
Dim data As Int32() = {4, 8}
Dim data2D(,) As Int32 =
{
{1, 2, 3},
{4, 5, 6},
{7, 8, 9}
}
'data2D(0, 0) = 1
'data2D(0, 1) = 2
'data2D(0, 2) = 3
'data2D(1, 0) = 4
'data2D(1, 1) = 5
'data2D(1, 2) = 6
'data2D(2, 0) = 7
'data2D(2, 1) = 8
'data2D(2, 2) = 9
' ADD_array(data(0), c, d) '------- ok
ADD_array2D(data2D(0, 0), c, d, ee) '------------ok
MsgBox("c=" + c.ToString + "d=" + d.ToString + "e=" + ee.ToString)
End Sub
End Class
- Apr 30 Tue 2013 23:44
這本期刊是不是SSCI期刊
如果你博士拿到了要回台灣找工作,或是現在正在讀研究所,以後想回台灣大學任教,那你一定要知道什麼是SCI和SSCI。台灣高等教育評鑑對SCI、SSCI的重視已經到了個瘋狂的境界了。
SCI 是 Science citation index的縮寫,SSCI 是 Social science citation index,所以簡單地說,這兩者就是期刊索引,能收進這兩個索引的期刊代表有一定的學術影響力,這可能也是台灣會為之瘋狂的原因。
要怎麼查一篇期刊是否為SCI或SSCI journal呢?有幾種方式:
第一種:到官方網站查詢 推薦指數***
SCI: http://science.thomsonreuters.com/cgi-bin/jrnlst/jloptions.cgi?PC=D
SSCI: http://www.thomsonscientific.com/cgi-bin/jrnlst/jloptions.cgi?PC=J
拿SSCI作例子好了,我想知道Foreign language annals 這本期刊是不是SSCI期刊,我就試著進搜尋畫面,打上foreign (大小寫均可)。
引用自:
http://newgenerationresearcher.blogspot.tw/2009/04/scissci-journal.html
- Feb 15 Fri 2013 01:47
正式邁入黃大仙新世紀
正式邁入黃大仙 新世紀 ~ 明月夜,短松岡
北韓於2013.0203 引發地下核爆震驚全球
十年生死不思量 兩茫茫
- Jan 07 Mon 2013 21:11
大姊名言
今天位於我後面的小組長跟等級超高的大姊聊天 說了名言被我摘要了起來: "人生就是這樣 老了還是一身病痛 郭台銘有錢又怎麼樣 吃得了餐餐鮑魚大餐嗎"
- Dec 15 Sat 2012 11:39
成功嶺第一周習得技能
由於大隊長要求放假要回報一下心得
來報告一下成功嶺第一周習得技能:
1. 過水功 (超大量洗婉)
2. 寫作文掰功 (題目:邁向成功嶺)
3. 罵不入耳功 (你罵你罵 我都有聽到)
4. 唱歌大聲功
5. 三分鐘洗澡+內務塞好好功
6. 上舖摔落不死功 (這隱藏祕技都讓我習得了....)
- Dec 04 Tue 2012 03:33
最後摘要
In this thesis, an innovation for detecting the nonoccupied car parking space proactively on the roadside based on the vehicle video recorder was proposed. The vehicle video recorder was embedded an image recognition function to detect the parking space on the road side while the vehicle is moving along the road. When a nonoccupied parking space is detected, the image and its GPS information are sent to the backend system via wireless communication system for updating the available parking space data on the database. To improve the recognition rate of the vehicle video recorder, the classifier on the backend is retrained periodically based on the received samples from the end users, and then using the retraining result to update the classifier on the vehicle. To encourage the user feedback the positive parking space information to the system for accumulating the training samples, the system is operated with membership and nonmembership. In this research, a bi-block size double hits (BBDH) was proposed. To increase the probability for finding the objects, and resulting to reduce the processing time per frame. The classifier used is a combination of Adaboost and the probabilistic boosting tree algorithms to improve the system’s recognition rate. According to the experimental results shown,the proposed method can improve the detection rate by 3~12% compared to the existed methods. The maximum recognition rate could reach 88% underthe processing rate is 20 frames per second. The figures had shown that the proposed system is suitable for real applications.
- Nov 11 Sun 2012 02:02
101學年成大工科系友大會領獎
連續兩年參加工科系友大會領獎 聽一樣的主任致詞 不一樣的系友談話
錢存銀行 人上天堂
夜裡走往圖書館的昏黃大道 不忘前塵 卻看今朝
- Nov 04 Sun 2012 02:48
VB2010~強型DataTable, 混合table 後 依時間排序
'----混合table 後 依時間排序---------
Dim Table_mix As New DataTable
'產生強型欄位
Table_mix.Columns.Add("DataTime", System.Type.GetType("System.DateTime")) '0
Table_mix.Columns.Add("AlarmCount", System.Type.GetType("System.Int32")) '1
Table_mix.Columns.Add("ActionCount", System.Type.GetType("System.Int32")) '2
For Each row In Table_AlarmRate.Rows
Dim rr As DataRow
rr = Table_mix.NewRow
rr(0) = row(0)
rr(1) = row(1)
rr(2) = 0
Table_mix.Rows.Add(rr)
Next
For Each row In Table_AlarmAction.Rows
Dim rr As DataRow
rr = Table_mix.NewRow
rr(0) = row(0)
rr(1) = 0
rr(2) = row(1)
Table_mix.Rows.Add(rr)
Next
Dim Table_mix_sortRows = From row In Table_mix Order By row.Item(0) Ascending Select row '依時間項(0)排序
' DataGridView2.DataSource = ss.CopyToDataTable
'Dim Table_mix_orderbyTime = ss.CopyToDataTable
' Dim NN = ss.Count
' Table_mix.Clear()
Dim Table_mix_orderbyTime As New DataTable
For Each col In Table_mix.Columns
Table_mix_orderbyTime.Columns.Add(col.ToString)
Next
For Each row In Table_mix_sortRows
Table_mix_orderbyTime.ImportRow(row)
' Dim a = 1
Next
DataGridView2.DataSource = Table_mix_orderbyTime
DataGridView2.Columns("DataTime").DefaultCellStyle.Format = "yyyy-MM-dd hh:mm:ss"
DataGridView2.Columns(0).Width = 150
' ---/混合table 依時間排序/---------
- Oct 24 Wed 2012 22:46
MSSQL~複製來源TABLE 並新增流水號 欄位
複製來源TABLE 並新增 流水號 欄位
Public Shared Sub sqlAction_addflow_column()
'可以先用sqldatasource元件自動產生連線字串 會放在web.config內
'Dim conn_str = "Data Source=JKSERVER-PC;Initial Catalog=SQLALARMLOG;Integrated Security=True"
' Dim conn_str = "Data Source=JKSERVER-PC;Initial Catalog=alarm;Integrated Security=True"
Dim conn_str = "Data Source=JKSERVER-PC;Initial Catalog=SQLALARMLOG;Integrated Security=True"
Dim conn1 As New SqlConnection(conn_str)
'Dim cmdstr = "ALTER Table ALARM Add idd int "
'Dim cmdstr = "CREATE Table ALARM2 from ALARM , ALTER Table ALARM2 Add idd int "
Dim cmdstr = "Select IDENTITY(INT,1,1) AS flow, * INTO NEW_ALARM FROM ALARM "
Dim sqlcmd = New SqlCommand(cmdstr, conn1)
'sqlcmd.Parameters.AddWithValue("@ID", ID_str)
'Dim sqlcmd = "ALTER TABLE ALARM ADD PRIMARY KEY (flow)"
Dim Adapter1 As SqlDataAdapter = New SqlDataAdapter(sqlcmd)
Dim cb As New SqlCommandBuilder
Dim alarmTable As New DataTable '建立本地記憶體資料表 內部容器裝載
'cb.DataAdapter = Adapter1
Adapter1.Fill(alarmTable)
End Sub
- Oct 24 Wed 2012 22:40
MSSQL~update 遠端同步本地端Table修改內容
Public Shared Function sqlAction_CollectAlarm_RowLines(ByRef DatagridviewIn As DataGridView) As List(Of String) 'Dim conn_str = "Data Source=JKSERVER-PC;Initial Catalog=SQLALARMLOG;Integrated Security=True" Dim conn_str = "Data Source=JKSERVER-PC;Initial Catalog=SQLALARMLOG;Integrated Security=True" Dim conn1 As New SqlConnection(conn_str) Dim cmdstr = "SELECT AlarmDateTime, ClearedDateTime, AlarmID ,flow,ST,AlarmRate,ActionRate FROM NEW_ALARM " Dim sqlcmd = New SqlCommand(cmdstr, conn1) 'sqlcmd.Parameters.AddWithValue("@ID", ID_str) Dim Adapter1 As SqlDataAdapter = New SqlDataAdapter(sqlcmd) Dim cb As New SqlCommandBuilder(Adapter1) ' for update ' Dim dataset1 = New Data.DataSet() '產生一個名為test 的 DataSet Dim alarmTable As New DataTable '建立本地記憶體資料表 內部容器裝載 Adapter1.Fill(alarmTable) '-------------查Action Rate---------------- Dim actR_list = sql_QueryDatalogValue_byTime(DatagridviewIn, alarmTable) 'Dim NN = actR_list.Count ' MsgBox(NN.ToString)` '-------------/查Action Rate/---------------- '---------列舉所有 start time ------------ ' Dim alarmTable_rows = From n In alarmTable ' Dim rows_N = alarmTable.LongCount Dim row_line_collect As New List(Of String) Dim symbol = "," Dim index = 0 For Each mm In alarmTable.Rows alarmTable.Rows(index).Item(6) = CInt(actR_list(index)) Dim colume_time = Convert.ToDateTime(mm(0)) ' Dim td1 As New DateTime(2012, 10, 17, 9, 0, 0) Dim td1 = colume_time Dim ts1 As New TimeSpan(0, 10, 0) 'Dim AmR As New List(Of String) Dim AmR = From column In alarmTable Where DateTime.Compare(column(0), td1 - ts1) 0 AndAlso DateTime.Compare(column(0), td1) 這個本地dataset修改後做 update 才有效 DatagridviewIn.DataSource = alarmTable conn1.Close() '------/抓取第一個欄位 裡的內容/-------------- Return row_line_collect End Function
- Oct 23 Tue 2012 20:58
MSSQL~修改連線資料庫內容
你觀念搞錯了,DataSet 是離線式資料庫,只是將資料從資料庫快取出來,放在記憶體內,DataSet 內的資料沒有主鍵值也可以改。
當資料要從 DataSet 寫回資料庫時,xxxxCommandBuilder 是依據主鍵值產生 UpdateCommand, DeleteCommand ,若是你資料庫本身沒有主鍵值,UpdateCommand 就無法明確指出要更新哪筆資料。
若是不想在資料庫內設置主鍵值,你就要放棄使用 CommandBuilder ,自己產生 UpdateCommand, DeleteCommand 。
參考:
http://social.msdn.microsoft.com/Forums/zh-TW/232/thread/79dd33cd-256c-4414-bbb8-26c7c3d5ac44/
- Oct 19 Fri 2012 23:05
2012_中技社得獎_個人清冊資料
黃傑琦
國立成功大學 工程科學系碩士班 碩二
創意作品:結合雲端服務之主動式戶外停車位探查暨自主防盜行車記錄器
傑出表現
1. 國外研討會論文發表1篇
2. 台灣區第五屆凌陽盃系統晶片創意應用大賽組 周邊控制組--創意獎
3. 2012萬潤創新創意競賽 電資組--金牌獎
4. 參與國科會計畫1項及合作計畫3項
5. 申請中專利1件
自我介紹
2006的時候,參與了行政院青年國是會議,與來自北中南的有志青年群一起與會審議式民主討論好幾個層面的國是議題,那是一段替別人想,也替自己重新省思個人,社會,更學習有效表達和溝通的歷程. 而創新與整合的能力更需要多元地培養領導者,決策者,企畫者的能力, 我很清楚的知道這就是我想要的. 而碩士班能夠進入成大工科所就讀是我人生中最幸運的事,在大學期間我走過了高師大光電通訊系與國立臺灣海洋大學通訊導航工程系,也短暫受教於中央大學遙測中心碩士學程,我期許自己可以藉由通資電全面性的工程背景推動整合人文與遙測環境雙面的知識為自然與人帶來更加和諧的共生方式 ; 我積極參與各項專題研究及國際上各項學術活動及競賽,使自己能夠應對國際化企業化的發展,並致力提攜新生領導人。
創意概述
根據聯合國美國二氧化碳資訊分析中心(CDIAC)研究分析,台灣每人每年的平均碳排量是1萬1580公斤,排名全亞洲第一;碳排密度更高居世界第一 . 因此對於節省行車能源問題的重要性可見一般。此作品創新於個人用戶的車用自主防盜的主動警報功能,於車體被竊時即時發送車體當前GPS定位座標和失竊簡訊給車主的手機與雲端資訊平台, 在對第一時間失竊車輛的警報和持續追蹤上有很大的助益; 另於正常行車視訊偵測器使用圖訊識別技術,具有利用影像主動探查路況上的空位停車格的功能,並回報雲端資料庫平台,以提供大眾戶外即時停車位查詢服務,可有效解決擁擠都市區找尋停車位一位難求的問題,降低行車碳排放量. 並且整體系統具有正樣本回饋雲端訓練機的架構設計,可不斷提高車載端偵測機的目標物辨識能力. 整體通訊回饋架構結合影像識別技術提供了一個節省能源耗費的車用適地性(LBS)雲端平台服務方案,提供了高度彈性與高實用價值的服務 .
得獎感言(150字內)
首先感謝中技社持續以來設獎的鼓勵,讓我設定其為這些年來努力目標夢想獎項,踩著資訊科技的腳步不斷的往這個夢想方向前進,很高興最後真能得到中技社的肯定,完成實踐這個夢想. 這六年來一步步的成長,伴隨著許多人的相互扶持,為各自的夢想挺進, 祝各位也能順利找到自己的夢想原動力.
- Oct 19 Fri 2012 14:58
原來死數是這個意思
右腳恢復測試完畢 希望從明天重新回到開始練舞的日子
一切感動的開始
結束一切的重新開始
原來死數 是這個意思 抑或...
我懷念陪我這兩年的 那頂史丁奇
史丁奇遺失的那天 是結束 也是開始